E-Retail 框架学习

1.程序入口:program.cs

Application.EnableVisualStyles();

 

启用应用程序的可视样式。 通常是 Main 函数的第一行,必须在应用程序中创建任何控件之前调用它;当调用时,无需单独的清单即可启用可视化样式。

Application.SetCompatibleTextRenderingDefault(false);

 

将某些控件上定义的 UseCompatibleTextRendering 属性设置为应用程序范围内的默认值。

  • true, new controls that support UseCompatibleTextRendering use the GDI+ based Graphics class for text rendering; if false, new controls use the GDI based TextRenderer class.‘ data-guid="040762dd64fa15b1fb1f7618f1fa86fb">true,则支持 UseCompatibleTextRendering 的新控件使用基于 GDI+ 的 Graphics 类进行文本呈现;
  • true, new controls that support UseCompatibleTextRendering use the GDI+ based Graphics class for text rendering; if false, new controls use the GDI based TextRenderer class.‘ data-guid="040762dd64fa15b1fb1f7618f1fa86fb">false,则新控件使用基于 GDI 的 TextRenderer 类。 
  • E-Retail 框架学习
    //系统初始化
    public static bool Init()
    {
        //sql 代理实例
        string ProxyMode = Eurostop.ProxyClient.SysError.ProxyMode;//数据成员,值取自配置文件,默认为0
        SqlProxyMode _sqlProxyMode = SqlProxyMode.Local;//自定义枚举项 ,none:无/Local:局域网/Wcf:Wcf分布式
        switch (ProxyMode)
        {
            case "0": _sqlProxyMode = SqlProxyMode.Local;
                 break;
            case "1": _sqlProxyMode = SqlProxyMode.Wcf ;
                 break;
            default: _sqlProxyMode = SqlProxyMode.None;
                 break;
        }
        Eurostop.Proxy.SqlProxy.Instance = Eurostop.Proxy.SqlProxyFactory.Instance(_sqlProxyMode);//全局静态变量赋值,如果是None和Local,则用LocalSqlProxy对象,如果是Wcf,则用WcfSqlProxy对象
        return true;
    }   
    E-Retail 框架学习

     

    判断系统是否已初始化Instace变量,如果是则显示登陆窗体

    2.登陆:

    构造函数:

    E-Retail 框架学习
    /// <summary>
    /// 注册用户皮肤
    /// </summary>
    public void RegisterUserSkins()
    {
        //窗口样式
        DevExpress.Skins.SkinManager.EnableFormSkins();
        DevExpress.UserSkins.BonusSkins.Register();
        DevExpress.UserSkins.OfficeSkins.Register();
    }    
    E-Retail 框架学习

     

    DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle(Config.SystemStyle);//加载皮肤样式,从配置文件读取

     

    窗体初始化:

    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(System.Threading.Thread.CurrentThread.CurrentCulture.Name);

    E-Retail 框架学习

    上一篇:go 应用程序性能测试


    下一篇:Qt的皮肤设计(Style Sheet)