public SettingsPane()
        {
            InitializeComponent();

            dirtyEventHandler = (object o, EventArgs e) =>
            {
                API.Instance.SetChangedSettings(true);
            };

            dirtyRoutedHandler = (object o, RoutedEventArgs e) =>
            {
                API.Instance.SetChangedSettings(true);
            };

            dirtyPropHandler = (object o, System.Windows.Forms.PropertyValueChangedEventArgs e) =>
            {
                API.Instance.SetChangedSettings(true);
            };

            CSSEditor = new TextEditor
            {
                FontFamily = new FontFamily("Consolas"),
                SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("CSS"),
                ShowLineNumbers = true,
                Options =
                {
                    ConvertTabsToSpaces = true,
                    IndentationSize = 2
                }
            };

            TemplateEditor = new TextEditor
            {
                FontFamily = new FontFamily("Consolas"),
                SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("HTML"),
                ShowLineNumbers = true,
                Options =
                {
                    ConvertTabsToSpaces = true,
                    IndentationSize = 2
                }
            };

            cssGrid.Children.Add(CSSEditor);
            templatesGrid.Children.Add(TemplateEditor);

            AdvancedPropertiesCheckBox = advancedPropertiesCheckBox;

            Reload();

            CSSEditor.TextChanged += dirtyEventHandler;
            TemplateEditor.TextChanged += dirtyEventHandler;
            runtimeSettingsPropertyGrid.PropertyValueChanged += dirtyPropHandler;
            instanceSettingsPropertyGrid.PropertyValueChanged += dirtyPropHandler;
            advancedPropertiesCheckBox.Checked += dirtyRoutedHandler;
            advancedPropertiesCheckBox.Unchecked += dirtyRoutedHandler;
        }
        public SettingsPane()
        {
            InitializeComponent();

            dirtyEventHandler = (object o, EventArgs e) =>
            {
                API.Instance.SetChangedSettings(true);
            };

            dirtyRoutedHandler = (object o, RoutedEventArgs e) =>
            {
                API.Instance.SetChangedSettings(true);
            };

            dirtyPropHandler = (object o, System.Windows.Forms.PropertyValueChangedEventArgs e) =>
            {
                API.Instance.SetChangedSettings(true);
            };

            CSSEditor = new TextEditor
            {
                FontFamily         = new FontFamily("Consolas"),
                SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("CSS"),
                ShowLineNumbers    = true,
                Options            =
                {
                    ConvertTabsToSpaces = true,
                    IndentationSize     = 2
                }
            };

            TemplateEditor = new TextEditor
            {
                FontFamily         = new FontFamily("Consolas"),
                SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("HTML"),
                ShowLineNumbers    = true,
                Options            =
                {
                    ConvertTabsToSpaces = true,
                    IndentationSize     = 2
                }
            };

            cssGrid.Children.Add(CSSEditor);
            templatesGrid.Children.Add(TemplateEditor);

            AdvancedPropertiesCheckBox = advancedPropertiesCheckBox;

            Reload();

            CSSEditor.TextChanged      += dirtyEventHandler;
            TemplateEditor.TextChanged += dirtyEventHandler;
            runtimeSettingsPropertyGrid.PropertyValueChanged  += dirtyPropHandler;
            instanceSettingsPropertyGrid.PropertyValueChanged += dirtyPropHandler;
            advancedPropertiesCheckBox.Checked   += dirtyRoutedHandler;
            advancedPropertiesCheckBox.Unchecked += dirtyRoutedHandler;
        }
Example #3
0
 private void InitializePropertyGrid(WindowsFormsHost host, object selectedObject, System.Windows.Forms.PropertyValueChangedEventHandler eventHandler)
 {
     (host.Child as System.Windows.Forms.PropertyGrid).SelectedObject = selectedObject;
     (this.propertyGridClusteringHost.Child as System.Windows.Forms.PropertyGrid).PropertyValueChanged += eventHandler;
 }