~ubuntu-branches/ubuntu/lucid/monodevelop/lucid

« back to all changes in this revision

Viewing changes to src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/FormattingPanel.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-01-10 14:25:59 UTC
  • mfrom: (1.2.5 upstream) (1.3.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100110142559-sorji5exvk9tyknr
Tags: 2.2+dfsg-2
* debian/rules/remove_support_for_non_debian_functionality.patch:
  + Also fix monodevelop-core-addins.pc to remove links to the
    addins we remove in Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
 
 
3
using Gtk;
 
4
 
 
5
using MonoDevelop.Core;
 
6
using MonoDevelop.Core.Gui.Dialogs;
 
7
 
 
8
using MonoDevelop.Ide.Gui.Content;
 
9
 
 
10
using MonoDevelop.CSharp.Formatting;
 
11
using MonoDevelop.CSharp.Parser;
 
12
 
 
13
namespace MonoDevelop.CSharp.Formatting
 
14
{
 
15
        partial class FormattingPanelWidget : Gtk.Bin {
 
16
                public FormattingPanelWidget ()
 
17
                {
 
18
                        Build ();
 
19
                        
 
20
                        indentCaseLabels.Active = FormattingProperties.IndentCaseLabels;
 
21
                        
 
22
                        // set checkbox/radiobutton values
 
23
                        switch (FormattingProperties.GotoLabelIndentStyle) {
 
24
                        case GotoLabelIndentStyle.LeftJustify:
 
25
                                indentGotoLabelsLeftJustify.Active = true;
 
26
                                break;
 
27
                        case GotoLabelIndentStyle.OneLess:
 
28
                                indentGotoLabelsUpOneLevel.Active = true;
 
29
                                break;
 
30
                        case GotoLabelIndentStyle.Normal:
 
31
                                indentGotoLabelsNormally.Active = true;
 
32
                                break;
 
33
                        }
 
34
                }
 
35
                
 
36
                public void Store ()
 
37
                {
 
38
                        FormattingProperties.IndentCaseLabels = indentCaseLabels.Active;
 
39
                        
 
40
                        if (indentGotoLabelsLeftJustify.Active)
 
41
                                FormattingProperties.GotoLabelIndentStyle = GotoLabelIndentStyle.LeftJustify;
 
42
                        else if (indentGotoLabelsUpOneLevel.Active)
 
43
                                FormattingProperties.GotoLabelIndentStyle = GotoLabelIndentStyle.OneLess;
 
44
                        else if (indentGotoLabelsNormally.Active)
 
45
                                FormattingProperties.GotoLabelIndentStyle = GotoLabelIndentStyle.Normal;
 
46
                }
 
47
        }
 
48
        
 
49
        public class FormattingPanel : OptionsPanel
 
50
        {
 
51
                FormattingPanelWidget widget;
 
52
                
 
53
                public override Widget CreatePanelWidget ()
 
54
                {
 
55
                        return (widget = new FormattingPanelWidget ());
 
56
                }
 
57
 
 
58
                public override void ApplyChanges ()
 
59
                {
 
60
                        widget.Store ();
 
61
                }
 
62
        }
 
63
}