diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs index 707fba8df4..353805ad29 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs @@ -26,12 +26,30 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", false); ((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true); - ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true); + ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked = SmartTagAutoShow; ((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true); - ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", true); + ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked = UseSmartTags; ((CheckBox)ControlDictionary["insertTodoCommentCheckBox"]).Checked = InsertTodoComment; } + 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); @@ -44,10 +62,10 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels public override bool StorePanelContents() { PropertyService.Set("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked); - PropertyService.Set("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", ((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked); - PropertyService.Set("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked); + PropertyService.Set("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", ((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked); + SmartTagAutoShow = ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked; PropertyService.Set("FormsDesigner.DesignerOptions.EnableInSituEditing", ((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked); - PropertyService.Set("FormsDesigner.DesignerOptions.UseSmartTags", ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked); + UseSmartTags = ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked; InsertTodoComment = ((CheckBox)ControlDictionary["insertTodoCommentCheckBox"]).Checked; return true; diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs index 2a38dd8c08..0b76dfee30 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs @@ -11,6 +11,7 @@ using System.Drawing; using System.ComponentModel.Design; using System.Windows.Forms.Design; using ICSharpCode.Core; +using ICSharpCode.FormsDesigner.Gui.OptionPanels; namespace ICSharpCode.FormsDesigner.Services { @@ -35,11 +36,11 @@ namespace ICSharpCode.FormsDesigner.Services this.showGrid = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true); this.snapToGrid = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true); - this.useSmartTags = PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", false); + this.useSmartTags = GeneralOptionsPanel.UseSmartTags; this.useSnapLines = PropertyService.Get("FormsDesigner.DesignerOptions.UseSnapLines", true); this.enableInSituEditing = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true); - this.objectBoundSmartTagAutoShow = PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true); + this.objectBoundSmartTagAutoShow = GeneralOptionsPanel.SmartTagAutoShow; this.useOptimizedCodeGeneration = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true); }