1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
4
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
6
using System.Windows.Forms;
7
using ICSharpCode.Core;
8
using ICSharpCode.SharpDevelop.Gui;
10
namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
12
public class GeneralOptionsPanel : XmlFormsOptionPanel
14
public override void LoadPanelContents()
16
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.FormsDesigner.Resources.WindowsFormsGeneralOptions.xfrm"));
18
((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", false);
19
((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true);
20
((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked = SmartTagAutoShow;
21
((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true);
22
((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked = UseSmartTags;
23
((CheckBox)ControlDictionary["insertTodoCommentCheckBox"]).Checked = InsertTodoComment;
24
((CheckBox)ControlDictionary["generateVSStyleHandlersCheckBox"]).Checked = GenerateVisualStudioStyleEventHandlers;
27
public static bool UseSmartTags {
29
return PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", true);
32
PropertyService.Set("FormsDesigner.DesignerOptions.UseSmartTags", value);
36
public static bool SmartTagAutoShow {
38
return PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true);
41
PropertyService.Set("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", value);
45
public static bool InsertTodoComment {
47
return PropertyService.Get("FormsDesigner.DesignerOptions.InsertTodoComment", false);
50
PropertyService.Set("FormsDesigner.DesignerOptions.InsertTodoComment", value);
54
public static bool GenerateVisualStudioStyleEventHandlers {
56
return PropertyService.Get("FormsDesigner.DesignerOptions.GenerateVisualStudioStyleEventHandlers", false);
59
PropertyService.Set("FormsDesigner.DesignerOptions.GenerateVisualStudioStyleEventHandlers", value);
63
public override bool StorePanelContents()
65
PropertyService.Set("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked);
66
PropertyService.Set("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", ((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked);
67
SmartTagAutoShow = ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked;
68
PropertyService.Set("FormsDesigner.DesignerOptions.EnableInSituEditing", ((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked);
69
UseSmartTags = ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked;
70
InsertTodoComment = ((CheckBox)ControlDictionary["insertTodoCommentCheckBox"]).Checked;
71
GenerateVisualStudioStyleEventHandlers = ((CheckBox)ControlDictionary["generateVSStyleHandlersCheckBox"]).Checked;