예제 #1
0
 /// <summary>
 /// Load the form state from a setting file and applies it
 /// </summary>
 private void SmartFormLoad(Object sender, EventArgs e)
 {
     ScaleHelper.AdjustForHighDPI(this);
     if (!String.IsNullOrEmpty(this.formGuid) && File.Exists(this.FormPropsFile))
     {
         Object obj = ObjectSerializer.Deserialize(this.FormPropsFile, this.formProps);
         this.formProps = (FormProps)obj;
         if (!this.formProps.WindowSize.IsEmpty)
         {
             this.Size = this.formProps.WindowSize;
         }
     }
     if (!String.IsNullOrEmpty(this.helpLink))
     {
         this.HelpButton         = true;
         this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.SmartFormHelpButtonClick);
     }
     ApplyProps?.Invoke(this);
 }
예제 #2
0
 /// <summary>
 /// Load the form state from a setting file and applies it
 /// </summary>
 private void SmartFormLoad(Object sender, EventArgs e)
 {
     this.ApplyTheming();
     if (this.StartPosition == FormStartPosition.CenterParent)
     {
         this.CenterToParent();
     }
     if (!String.IsNullOrEmpty(this.formGuid) && File.Exists(this.FormPropsFile))
     {
         Object obj = ObjectSerializer.Deserialize(this.FormPropsFile, this.formProps);
         this.formProps = (FormProps)obj;
         if (!this.formProps.WindowSize.IsEmpty && this.FormBorderStyle == FormBorderStyle.Sizable)
         {
             this.Size = this.formProps.WindowSize;
         }
     }
     if (!String.IsNullOrEmpty(this.helpLink))
     {
         this.HelpButton         = true;
         this.HelpButtonClicked += new CancelEventHandler(this.SmartFormHelpButtonClick);
     }
     ApplyProps?.Invoke(this);
 }