/// <summary> /// 设置页面 /// </summary> /// <param name="windowNotepad">操作页面</param> public WindowSet(WindowNotepad windowNotepad) : this() { WindowNotepad = windowNotepad; Opacity = windowNotepad.Opacity; GridTitleBottom.Height = windowNotepad.WindowSettings.TitleBottomHeight; TextBlock1.FontSize = windowNotepad.TxtTitleBottom.FontSize; Boot = AutoBoot.GetAutoBootStatu(SystemCommon.SystemName); }
private void Button_SaveSetting_Click(object sender, RoutedEventArgs e) { AppSettings.Default.autoSave = Toggle_AutoSave.IsChecked.Value; AppSettings.Default.autoBoot = Toggle_Boot.IsChecked.Value; AppSettings.Default.Save(); AutoBoot.SetAutoStart(Toggle_Boot.IsChecked.Value); //MessageBox.Show("保存完成", "提示:", MessageBoxButton.OK); Close(); }
/// <summary> /// 设置页面 /// </summary> public WindowSet() { InitializeComponent(); //移动 MouseLeftButtonDown += (sender, e) => { DragMove(); }; //关闭 BtnClose.Click += (sender, e) => { Close(); }; //确认 BtnCheck.Click += (sender, e) => { foreach (WindowNotepad notepad in NotepadManage.WindowList) { notepad.ShowInTaskbar = SystemSetting.ShowInTaskbar; if (ChkNotepadAll.IsChecked == true || notepad.Equals(WindowNotepad)) { notepad.Opacity = SliderOpacity.Value; notepad.WindowSettings.TitleBottomHeight = SliderTitleBottom.Value; notepad.TxtTitleBottom.FontSize = SliderTitleBottomFontSize.Value; if (notepad.Top < 0) { notepad.GridTitleBottom.Height = SliderTitleBottom.Value; while ((Int64)notepad.Top != (Int64)(-notepad.ActualHeight + notepad.WindowSettings.TitleBottomHeight)) { notepad.Top += notepad.Top >= -notepad.ActualHeight + notepad.WindowSettings.TitleBottomHeight ? -1 : 1; } } } } //设置主窗体 SystemCommon.WindowMain.ShowInTaskbar = !SystemSetting.ShowInTaskbar; //非调试模式 if (!System.Diagnostics.Debugger.IsAttached) { try { if (Boot == true) { //开机启动 ShortcutCreator.CreateShortcutOnDesktop(SystemCommon.SystemName); if (!AutoBoot.SetAutoBootStatu1(true, SystemCommon.SystemName)) { AutoBoot.SetAutoBootStatu(true, SystemCommon.SystemName); } } else { //取消开机启动 AutoBoot.SetAutoBootStatu1(false, SystemCommon.SystemName); AutoBoot.SetAutoBootStatu(false, SystemCommon.SystemName); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } Close(); }; }