Example #1
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Settings set = new Settings();

            bool update = false;

            if (this.WindowState == WindowState.Maximized)
            {// 最大化状態
                if (!set.AppSettings.Maximized)
                {
                    set.AppSettings.Maximized = true;
                    update = true;
                }
            }
            else
            {// 最大化以外
                if (set.AppSettings.Maximized)
                {
                    set.AppSettings.Maximized = false;
                    update = true;
                }

                if (set.AppSettings.Width != this.Width ||
                    set.AppSettings.Height != this.Height)
                {// Windows サイズが変化している
                    set.AppSettings.Width = (int)this.Width;
                    set.AppSettings.Height = (int)this.Height;

                    update = true;
                }
            }

            if (update) { set.write(); }
        }
Example #2
0
        private void SetupButton_Click(object sender, RoutedEventArgs e)
        {
            bool? result = _Option.show();
            if (result == true)
            {
                Settings set = new Settings();
                set.AppSettings = _Option.Data;
                set.write();

                editBox.FontFamily = new FontFamily(_Option.Data.FontName);
                editBox.FontSize = _Option.Data.FontSize;

                if (_Option.WordWrap)
                {
                    editBox.TextWrapping = TextWrapping.Wrap;
                }
                else
                {
                    editBox.TextWrapping = TextWrapping.NoWrap;
                }
            }
        }