public void CreateSettings() { var settings = new MainFormSettings(); settings.FormLocation = new Point(50, 50); var manager = new MainFormSettingsManager(settings, "settings/window.json"); manager.Save(); manager.Dispose(); }
private void SaveMainFormSettings() { MainFormSettings settings = new MainFormSettings() { WindowState = WindowState, Left = normalLeft, Top = normalTop, Width = normalWidth, Height = normalHeight, DockLocation = dockLocation }; Properties.Settings.Default.MainFormSettings = JsonConvert.SerializeObject(settings); Properties.Settings.Default.Save(); }
private void MainForm_Load(object sender, EventArgs e) { MainFormSettings settings = _sessionSaver.Load(); if (settings != null) { txtSourcePathForClone.Text = settings.SourcePathForClone; txtSourceExtensionForClone.Text = settings.SourceExtensionForClone; txtTargetPathForClone.Text = settings.TargetPathForClone; txtTargetExtensionForClone.Text = settings.TargetExtensionForClone; txtOrganizationTarget.Text = settings.OrganizationTarget; chkIncludeSubfolders.Checked = settings.IncludeSubfolders; chkReviewBeforeApplying.Checked = settings.ReviewBeforeApplying; } }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); if (!e.Cancel) { MainFormSettings settings = new MainFormSettings(); settings.SourcePathForClone = txtSourcePathForClone.Text; settings.SourceExtensionForClone = txtSourceExtensionForClone.Text; settings.TargetPathForClone = txtTargetPathForClone.Text; settings.TargetExtensionForClone = txtTargetExtensionForClone.Text; settings.OrganizationTarget = txtOrganizationTarget.Text; settings.IncludeSubfolders = chkIncludeSubfolders.Checked; settings.ReviewBeforeApplying = chkReviewBeforeApplying.Checked; _sessionSaver.Save(settings); } }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); if (!e.Cancel) { MainFormSettings settings = new MainFormSettings(); settings.SourcePathForClone = txtSourcePathForClone.Text; settings.SourceExtensionForClone = txtSourceExtensionForClone.Text; settings.TargetPathForClone = txtTargetPathForClone.Text; settings.TargetExtensionForClone = txtTargetExtensionForClone.Text; settings.OrganizationTarget = txtOrganizationTarget.Text; settings.IncludeSubfolders = chkIncludeSubfolders.Checked; settings.ReviewBeforeApplying = chkReviewBeforeApplying.Checked; _sessionSaver.Save(settings); } }
private void LoadMainFormSettings() { MainFormSettings settings = JsonConvert.DeserializeObject <MainFormSettings>(Properties.Settings.Default.MainFormSettings); if (settings == null) { return; } WindowState = settings.WindowState; normalTop = settings.Top; normalLeft = settings.Left; normalWidth = settings.Width; normalHeight = settings.Height; dockLocation = settings.DockLocation; if (WindowState == FormWindowState.Normal) { Top = settings.Top; Left = settings.Left; Width = settings.Width; Height = settings.Height; } }
private void pictureBox6_Click(object sender, EventArgs e) { MainFormSettings mf = new MainFormSettings(); mf.ShowDialog(this); }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { Properties.Settings.Default.WindowTheme = dlaf.LookAndFeel.ActiveSkinName; Properties.Settings.Default.WindowGeometry = MainFormSettings.GeometryToString(this); Properties.Settings.Default.Save(); }
public MainForm() { InitializeComponent(); dlaf.LookAndFeel.SkinName = Properties.Settings.Default.WindowTheme; MainFormSettings.GeometryFromString(Properties.Settings.Default.WindowGeometry, this); }