public SmartForm() { this.formProps = new FormProps(); this.Load += new EventHandler(this.SmartFormLoad); this.Shown += new EventHandler(this.SmartFormShown); this.FormClosed += new FormClosedEventHandler(this.SmartFormClosed); }
public SmartForm() { this.formProps = new FormProps(); this.Load += new EventHandler(this.SmartFormLoad); this.FormClosed += new FormClosedEventHandler(this.SmartFormClosed); EventManager.AddEventHandler(this, EventType.ApplyTheme); ScaleHelper.AdjustForHighDPI(this); }
public SmartForm() { this.formProps = new FormProps(); this.formGuid = Guid.Empty.ToString().ToUpper(); this.Load += new EventHandler(this.SmartFormLoad); this.Shown += new EventHandler(this.SmartFormShown); this.FormClosing += new FormClosingEventHandler(this.SmartFormClosing); }
/// <summary> /// Load the form state from a setting file and applies it /// </summary> private void SmartFormLoad(Object sender, EventArgs e) { if (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; } }
/// <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); }
/// <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); }
/// <summary> /// Load the form state from a setting file and applies it /// </summary> private void SmartFormLoad(Object sender, EventArgs e) { 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); } if (this.ApplyProps != null) this.ApplyProps(this); }