Ejemplo n.º 1
0
        private void UpdateResoures(ToolWindow w)
        {
            var key = ThemeColors.Theme.Blue;

            if (this.BuleRadio.IsChecked.Value)
            {
                key = ThemeColors.Theme.Blue;
            }
            else if (this.LightRadio.IsChecked.Value)
            {
                key = ThemeColors.Theme.Light;
            }
            else if (this.DarkRadio.IsChecked.Value)
            {
                key = ThemeColors.Theme.Dark;
            }
            foreach (var kvp in ThemeColors.pallete[key])
            {
                w.Resources[kvp.Key] = new SolidColorBrush((Color)ColorConverter.ConvertFromString(kvp.Value));
            }
        }
Ejemplo n.º 2
0
        } // end sub

        private void InsertTextButton_Click(object sender, RoutedEventArgs e)
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = this.uiCulture;

            var c = new Net.Surviveplus.EditorPlus.UI.InsertText()
            {
                Executable = this.executable
            };

            // ボタンが押されたら、Text プロパティを表示してみます。
            c.InsertToHeadExecuted += (s2, e2) =>
            {
                var c2 = s2 as InsertText;
                //MessageBox.Show("行頭挿入 / スキップ:" + c2.Skip.ToString() + "\r\n" + "\r\n" + c2.Text);
            };

            // ボタンが押されたら、Text プロパティを表示してみます。
            c.InsertToEndExecuted += (s2, e2) =>
            {
                var c2 = s2 as InsertText;
                //MessageBox.Show("行末挿入  / スキップ:" + c2.Skip.ToString() + "\r\n" + "\r\n" + c2.Text);
            };

            // メインウィンドウの Executable ボタンと連動して、ボタンの有効・無効を切り替えます。
            this.ExecutableChanged += (s2, e2) =>
            {
                c.Executable = this.executable;
            };

            var w = new ToolWindow()
            {
                Title = "Insert Text", Content = c
            };

            this.UpdateResoures(w);
            toolWindows.Add(w);
            w.Show();
        }