~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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)
 
3
 
 
4
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
 
5
using System;
 
6
using System.Windows.Forms;
 
7
using ICSharpCode.Core;
 
8
using ICSharpCode.SharpDevelop.Gui;
 
9
 
 
10
namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
 
11
{
 
12
        public class GeneralOptionsPanel : XmlFormsOptionPanel
 
13
        {
 
14
                public override void LoadPanelContents()
 
15
                {
 
16
                        SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.FormsDesigner.Resources.WindowsFormsGeneralOptions.xfrm"));
 
17
                        
 
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;
 
25
                }
 
26
                
 
27
                public static bool UseSmartTags {
 
28
                        get {
 
29
                                return PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", true);
 
30
                        }
 
31
                        set {
 
32
                                PropertyService.Set("FormsDesigner.DesignerOptions.UseSmartTags", value);
 
33
                        }
 
34
                }
 
35
                
 
36
                public static bool SmartTagAutoShow {
 
37
                        get {
 
38
                                return PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true);
 
39
                        }
 
40
                        set {
 
41
                                PropertyService.Set("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", value);
 
42
                        }
 
43
                }
 
44
                
 
45
                public static bool InsertTodoComment {
 
46
                        get {
 
47
                                return PropertyService.Get("FormsDesigner.DesignerOptions.InsertTodoComment", false);
 
48
                        }
 
49
                        set {
 
50
                                PropertyService.Set("FormsDesigner.DesignerOptions.InsertTodoComment", value);
 
51
                        }
 
52
                }
 
53
                
 
54
                public static bool GenerateVisualStudioStyleEventHandlers {
 
55
                        get {
 
56
                                return PropertyService.Get("FormsDesigner.DesignerOptions.GenerateVisualStudioStyleEventHandlers", false);
 
57
                        }
 
58
                        set {
 
59
                                PropertyService.Set("FormsDesigner.DesignerOptions.GenerateVisualStudioStyleEventHandlers", value);
 
60
                        }
 
61
                }
 
62
                
 
63
                public override bool StorePanelContents()
 
64
                {
 
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;
 
72
                        
 
73
                        return true;
 
74
                }
 
75
        }
 
76
}