Пример #1
0
 public BaseDialogForm()
 {
     InitializeComponent();
     try
     {
         WinFormsUtils.SetNewControlFont(this, (Font)FrwConfig.Instance.GetPropertyValue(FrwSimpleWinCRUDConfig.APPLICATION_FONT));//if this.AutoScaleMode = Font - Setting the font will change the size of the window
     }
     catch (Exception)
     {
         //to can show dialog designer
     }
 }
Пример #2
0
        protected void LoadConfig()
        {
            /////////////////////////////////////////////////
            try
            {
                string filename = GetStateConfigFileName();
                if (File.Exists(filename))
                {
                    configFileStr = File.ReadAllText(filename, Encoding.UTF8);
                    DocPanelState state = JsonSerializeHelper.LoadFromString <DocPanelState>(configFileStr);
                    LoadUserSettings(state.UserSettings);
                }
            }
            catch (Exception ex)
            {
                Log.LogError("Can not read config for " + GetType().ToString(), ex);
            }


            string configFile = GetContentConfigFileName();

            if (File.Exists(configFile))
            {
                configLayoutStr = File.ReadAllText(configFile);
                Stream xmlStream = new MemoryStream(Encoding.UTF8.GetBytes(configLayoutStr));
                dockPanel.LoadFromXml(xmlStream, m_deserializeDockContent);
                //xmlStream.Close();
            }
            try
            {
                // Font installation for all forms
                WinFormsUtils.SetNewControlFont(this, (Font)FrwConfig.Instance.GetPropertyValue(FrwSimpleWinCRUDConfig.APPLICATION_FONT));//if this.AutoScaleMode = Font - Setting the font will change the size of the window
            }
            catch (Exception ex)
            {
                Log.LogError("Can not set font ", ex);
            }
        }
Пример #3
0
 private void FontSetting_ValueChanged(object sender, JSettingChangedEventArgs e)
 {
     WinFormsUtils.SetNewControlFont(this, (Font)e.Setting.Value);
 }