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

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.XmlEditor/MonoDevelop.Xml.Formatting/XmlFormatterWriter.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:
127
127
                bool v2;
128
128
                int lastEmptyLineCount;
129
129
                
130
 
                XmlFormatingSettings formatSettings = new XmlFormatingSettings ();
131
 
                XmlFormatingSettings defaultFormatSettings = new XmlFormatingSettings ();
 
130
                XmlFormattingSettings formatSettings = new XmlFormattingSettings ();
 
131
                XmlFormattingSettings defaultFormatSettings = new XmlFormattingSettings ();
132
132
                internal TextStylePolicy TextPolicy;
133
133
                
134
134
                // Constructors
180
180
                                new char [] {'"', '&', '<', '>', '\r', '\n'};
181
181
                }
182
182
                
183
 
                Dictionary<XmlNode,XmlFormatingSettings> formatMap = new Dictionary<XmlNode, XmlFormatingSettings> ();
 
183
                Dictionary<XmlNode,XmlFormattingSettings> formatMap = new Dictionary<XmlNode, XmlFormattingSettings> ();
184
184
                
185
185
                public void WriteNode (XmlNode node, XmlFormattingPolicy formattingPolicy, TextStylePolicy textPolicy)
186
186
                {
187
187
                        this.TextPolicy = textPolicy;
188
188
                        formatMap.Clear ();
189
189
                        defaultFormatSettings = formattingPolicy.DefaultFormat;
190
 
                        foreach (XmlFormatingSettings format in formattingPolicy.Formats) {
 
190
                        foreach (XmlFormattingSettings format in formattingPolicy.Formats) {
191
191
                                foreach (string xpath in format.ScopeXPath) {
192
192
                                        foreach (XmlNode n in node.SelectNodes (xpath))
193
193
                                                formatMap [n] = format;
198
198
                
199
199
                void WriteNode (XmlNode node)
200
200
                {
201
 
                        XmlFormatingSettings oldFormat = formatSettings;
 
201
                        XmlFormattingSettings oldFormat = formatSettings;
202
202
                        SetFormat (node);
203
203
                        
204
204
                        switch (node.NodeType) {
321
321
                
322
322
                void SetFormat (XmlNode node)
323
323
                {
324
 
                        XmlFormatingSettings s;
 
324
                        XmlFormattingSettings s;
325
325
                        if (formatMap.TryGetValue (node, out s)) {
326
326
                                formatSettings = s;
327
327
                        }