From f3f58ba2967595a54a63883ed82dc6cd7638dfc7 Mon Sep 17 00:00:00 2001 From: PeterForstmeier Date: Tue, 1 May 2012 20:17:53 +0200 Subject: [PATCH] Cleanup --- .../Src/Designer/BooDesignerGenerator.cs | 2 +- .../FormsDesigner/Project/FormsDesigner.addin | 2 +- .../Project/FormsDesigner.csproj | 6 +- .../CSharpDesignerGenerator.cs | 2 +- .../VBNetDesignerGenerator.cs | 2 +- ...anelXaml.xaml => GeneralOptionsPanel.xaml} | 2 +- .../OptionPanels/GeneralOptionsPanel.xaml.cs | 94 +++++++++++++++++++ .../Src/Services/DesignerOptionService.cs | 4 +- .../Src/Services/EventBindingService.cs | 2 +- 9 files changed, 105 insertions(+), 11 deletions(-) rename src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/{GeneralOptionsPanelXaml.xaml => GeneralOptionsPanel.xaml} (97%) create mode 100644 src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptionsPanel.xaml.cs diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerGenerator.cs b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerGenerator.cs index f386348d24..3bdde51e23 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerGenerator.cs +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerGenerator.cs @@ -111,7 +111,7 @@ namespace Grunwald.BooBinding.Designer b.AppendLine(indentation); b.AppendLine(indentation + "private def " + eventMethodName + "(" + param + "):"); if (string.IsNullOrEmpty(body)) { - if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanelXaml.InsertTodoComment) { + if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel.InsertTodoComment) { body = "// TODO: Implement " + eventMethodName; } } diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin index ab4009d624..c08d3b037f 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin @@ -306,7 +306,7 @@ + class = "ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel"/> ImageResourceEditorDialog.cs - - GeneralOptionsPanelXaml.xaml + + GeneralOptionsPanel.xaml Code @@ -192,7 +192,7 @@ - + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs index 1045750df5..1be3a24433 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs @@ -31,7 +31,7 @@ namespace ICSharpCode.FormsDesigner b.AppendLine(indentation + "void " + eventMethodName + "(" + param + ")"); b.AppendLine(indentation + "{"); if (string.IsNullOrEmpty(body)) { - if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanelXaml.InsertTodoComment) { + if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel.InsertTodoComment) { body = "// TODO: Implement " + eventMethodName; } } diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs index d8763ae392..937c85aadb 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.FormsDesigner b.AppendLine(indentation); b.AppendLine(indentation + "Sub " + eventMethodName + "(" + param + ")"); if (string.IsNullOrEmpty(body)) { - if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanelXaml.InsertTodoComment) { + if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel.InsertTodoComment) { body = "' TODO: Implement " + eventMethodName; } } diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptionsPanelXaml.xaml b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptionsPanel.xaml similarity index 97% rename from src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptionsPanelXaml.xaml rename to src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptionsPanel.xaml index e917c7464b..ba53124467 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptionsPanelXaml.xaml +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptionsPanel.xaml @@ -1,4 +1,4 @@ - + /// Interaction logic for GeneralOptionsPanelXaml.xaml + /// + public partial class GeneralOptionsPanel : OptionPanel + { + public GeneralOptionsPanel() + { + InitializeComponent(); + } + + public static bool UseSmartTags { + get { + return PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", true); + } + set { + PropertyService.Set("FormsDesigner.DesignerOptions.UseSmartTags", value); + } + } + + public static bool SmartTagAutoShow { + get { + return PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true); + } + set { + PropertyService.Set("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", value); + } + } + + public static bool InsertTodoComment { + get { + return PropertyService.Get("FormsDesigner.DesignerOptions.InsertTodoComment", false); + } + set { + PropertyService.Set("FormsDesigner.DesignerOptions.InsertTodoComment", value); + } + } + + public static bool GenerateVisualStudioStyleEventHandlers { + get { + return PropertyService.Get("FormsDesigner.DesignerOptions.GenerateVisualStudioStyleEventHandlers", false); + } + set { + PropertyService.Set("FormsDesigner.DesignerOptions.GenerateVisualStudioStyleEventHandlers", value); + } + } + + + public override bool SaveOptions() + { + + PropertyService.Set("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", sortAlphabeticalCheckBox.IsChecked); + PropertyService.Set("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", optimizedCodeGenerationCheckBox.IsChecked); + SmartTagAutoShow = (bool)this.smartTagAutoShowCheckBox.IsChecked; + PropertyService.Set("FormsDesigner.DesignerOptions.EnableInSituEditing", inPlaceEditCheckBox.IsChecked); + UseSmartTags = (bool)useSmartTagsCheckBox.IsChecked; + InsertTodoComment = (bool)insertTodoCommentCheckBox.IsChecked; + GenerateVisualStudioStyleEventHandlers = (bool)generateVSStyleHandlersCheckBox.IsChecked; + + return true; + } + + + public override void LoadOptions() + { + base.LoadOptions(); + Initialize(); + } + + private void Initialize() + { + this.sortAlphabeticalCheckBox.IsChecked = PropertyService.Get("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", false); + this.optimizedCodeGenerationCheckBox.IsChecked = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true); + this.smartTagAutoShowCheckBox.IsChecked = SmartTagAutoShow; + this.inPlaceEditCheckBox.IsChecked = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true); + this.useSmartTagsCheckBox.IsChecked = UseSmartTags; + this.insertTodoCommentCheckBox.IsChecked = InsertTodoComment; + this.generateVSStyleHandlersCheckBox.IsChecked = GenerateVisualStudioStyleEventHandlers; + } + } +} \ No newline at end of file diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs index bf93b98387..3dce3f7246 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs @@ -31,11 +31,11 @@ namespace ICSharpCode.FormsDesigner.Services this.showGrid = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true); this.snapToGrid = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true); - this.useSmartTags = GeneralOptionsPanelXaml.UseSmartTags; + this.useSmartTags = GeneralOptionsPanel.UseSmartTags; this.useSnapLines = PropertyService.Get("FormsDesigner.DesignerOptions.UseSnapLines", true); this.enableInSituEditing = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true); - this.objectBoundSmartTagAutoShow = GeneralOptionsPanelXaml.SmartTagAutoShow; + this.objectBoundSmartTagAutoShow = GeneralOptionsPanel.SmartTagAutoShow; this.useOptimizedCodeGeneration = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true); } diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/EventBindingService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/EventBindingService.cs index fe36f022db..1073ac5e6e 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/EventBindingService.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/EventBindingService.cs @@ -40,7 +40,7 @@ namespace ICSharpCode.FormsDesigner.Services string GetEventHandlerNameFormat() { - if (GeneralOptionsPanelXaml.GenerateVisualStudioStyleEventHandlers) { + if (GeneralOptionsPanel.GenerateVisualStudioStyleEventHandlers) { return "{0}_{1}"; } return "{0}{1}";