~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/CodeGenerationPanel.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 System;
 
5
using System.Windows.Forms;
 
6
using ICSharpCode.Core;
 
7
 
 
8
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
 
9
{
 
10
        public class CodeGenerationPanel : XmlFormsOptionPanel
 
11
        {
 
12
                static readonly string codeGenerationProperty = "SharpDevelop.UI.CodeGenerationOptions";
 
13
                
 
14
                public override void LoadPanelContents()
 
15
                {
 
16
                        SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.CodeGenerationOptionsPanel.xfrm"));
 
17
                        
 
18
                        Properties p = (Properties)PropertyService.Get(codeGenerationProperty, new Properties());
 
19
                        
 
20
                        ((CheckBox)ControlDictionary["generateAdditonalCommentsCheckBox"]).Checked = p.Get("GenerateAdditionalComments", true);
 
21
                        ((CheckBox)ControlDictionary["generateDocCommentsCheckBox"]).Checked       = p.Get("GenerateDocumentComments", true);
 
22
                        ((CheckBox)ControlDictionary["useFullTypeNamesCheckBox"]).Checked          = p.Get("UseFullyQualifiedNames", true);
 
23
                        
 
24
                        ((CheckBox)ControlDictionary["blankLinesBetweenMemberCheckBox"]).Checked   = p.Get("BlankLinesBetweenMembers", true);
 
25
                        ((CheckBox)ControlDictionary["elseOnClosingCheckbox"]).Checked             = p.Get("ElseOnClosing", true);
 
26
                        ((CheckBox)ControlDictionary["startBlockOnTheSameLineCheckBox"]).Checked   = p.Get("StartBlockOnSameLine", true);
 
27
                }
 
28
                
 
29
                public override bool StorePanelContents()
 
30
                {
 
31
                        Properties p = (Properties)PropertyService.Get(codeGenerationProperty, new Properties());
 
32
                        p.Set("GenerateAdditionalComments", ((CheckBox)ControlDictionary["generateAdditonalCommentsCheckBox"]).Checked);
 
33
                        p.Set("GenerateDocumentComments",   ((CheckBox)ControlDictionary["generateDocCommentsCheckBox"]).Checked);
 
34
                        p.Set("UseFullyQualifiedNames",     ((CheckBox)ControlDictionary["useFullTypeNamesCheckBox"]).Checked);
 
35
                        p.Set("BlankLinesBetweenMembers",   ((CheckBox)ControlDictionary["blankLinesBetweenMemberCheckBox"]).Checked);
 
36
                        p.Set("ElseOnClosing",              ((CheckBox)ControlDictionary["elseOnClosingCheckbox"]).Checked);
 
37
                        p.Set("StartBlockOnSameLine",       ((CheckBox)ControlDictionary["startBlockOnTheSameLineCheckBox"]).Checked);
 
38
                        PropertyService.Set(codeGenerationProperty, p);
 
39
                        return true;
 
40
                }
 
41
        }
 
42
}