~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.XmlEditor/MonoDevelop.Xml.Formatting/XmlFormattingPolicyPanelWidget.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
                {
42
42
                        this.Build ();
43
43
                        
44
 
                        store = new ListStore (typeof(string), typeof (XmlFormatingSettings));
 
44
                        store = new ListStore (typeof(string), typeof (XmlFormattingSettings));
45
45
                        listView.Model = store;
46
46
                        listView.AppendColumn ("", new CellRendererText (), "text", 0);
47
47
                        
76
76
                {
77
77
                        store.Clear ();
78
78
                        AppendSettings (policy.DefaultFormat);
79
 
                        foreach (XmlFormatingSettings s in policy.Formats)
 
79
                        foreach (XmlFormattingSettings s in policy.Formats)
80
80
                                AppendSettings (s);
81
81
                }
82
82
 
83
 
                TreeIter AppendSettings (XmlFormatingSettings format)
 
83
                TreeIter AppendSettings (XmlFormattingSettings format)
84
84
                {
85
85
                        return store.AppendValues (GetName (format), format);
86
86
                }
87
87
                
88
 
                string GetName (XmlFormatingSettings format)
 
88
                string GetName (XmlFormattingSettings format)
89
89
                {
90
90
                        if (format == policy.DefaultFormat)
91
91
                                return GettextCatalog.GetString ("Default");
108
108
                {
109
109
                        TreeIter it;
110
110
                        if (listView.Selection.GetSelected (out it)) {
111
 
                                XmlFormatingSettings s = (XmlFormatingSettings) store.GetValue (it, 1);
 
111
                                var s = (XmlFormattingSettings) store.GetValue (it, 1);
112
112
                                FillFormat (s);
113
113
                        } else
114
114
                                FillFormat (null);
115
115
                        UpdateButtons ();
116
116
                }
117
117
                
118
 
                XmlFormatingSettings currentFormat;
 
118
                XmlFormattingSettings currentFormat;
119
119
                
120
 
                void FillFormat (XmlFormatingSettings format)
 
120
                void FillFormat (XmlFormattingSettings format)
121
121
                {
122
122
                        currentFormat = format;
123
123
                        if (currentFormat != null && currentFormat.ScopeXPath.Count == 0)
179
179
                
180
180
                protected virtual void OnButtonAddClicked (object sender, System.EventArgs e)
181
181
                {
182
 
                        XmlFormatingSettings format = new XmlFormatingSettings ();
 
182
                        var format = new XmlFormattingSettings ();
183
183
                        policy.Formats.Add (format);
184
184
                        TreeIter it = AppendSettings (format);
185
185
                        listView.Selection.SelectIter (it);
189
189
                {
190
190
                        TreeIter it;
191
191
                        if (listView.Selection.GetSelected (out it)) {
192
 
                                XmlFormatingSettings s = (XmlFormatingSettings) store.GetValue (it, 1);
 
192
                                var s = (XmlFormattingSettings) store.GetValue (it, 1);
193
193
                                policy.Formats.Remove (s);
194
194
                                TreePath p = store.GetPath (it);
195
195
                                store.Remove (ref it);
208
208
                {
209
209
                        TreeIter it;
210
210
                        if (listView.Selection.GetSelected (out it)) {
211
 
                                XmlFormatingSettings s = (XmlFormatingSettings) store.GetValue (it, 1);
 
211
                                var s = (XmlFormattingSettings) store.GetValue (it, 1);
212
212
                                store.SetValue (it, 0, GetName (s));
213
213
                        }
214
214
                }
217
217
                {
218
218
                        TreeIter it;
219
219
                        if (listView.Selection.GetSelected (out it)) {
220
 
                                XmlFormatingSettings s = (XmlFormatingSettings) store.GetValue (it, 1);
 
220
                                var s = (XmlFormattingSettings) store.GetValue (it, 1);
221
221
                                buttonAdd.Sensitive = true;
222
222
                                buttonRemove.Sensitive = s != policy.DefaultFormat;
223
223
                        } else {