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

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Core/XmlReadHelper.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
                {
50
50
                        ReadList (reader, new string[] { endNode }, callback);
51
51
                }
 
52
                
52
53
                public static void ReadList (XmlReader reader, ICollection<string> endNodes, ReaderCallback callback)
53
54
                {
54
55
                        ReadList (reader, endNodes, delegate(ReadCallbackData data) { 
73
74
                        if (reader.IsEmptyElement) 
74
75
                                return;
75
76
                        ReadCallbackData data = new ReadCallbackData ();
76
 
                        bool didReadStartNode = false;
77
 
                        while (reader.Read()) {
78
 
                         skip:
 
77
                        bool didReadStartNode = endNodes.Contains (reader.LocalName);
 
78
                        
 
79
                        while (data.SkipNextRead || reader.Read()) {
79
80
                                data.SkipNextRead = false;
80
81
                                switch (reader.NodeType) {
81
82
                                case XmlNodeType.EndElement:
82
83
                                        if (endNodes.Contains (reader.LocalName)) 
83
84
                                                return;
84
 
                                        LoggingService.LogWarning ("Unknown end node: " + reader.LocalName + " valid end nodes are: " + ConcatString (endNodes));
 
85
                                        LoggingService.LogWarning (
 
86
                                                "Encountered end node '{0}' when expecting one of '{1}'. Location {2}",
 
87
                                                reader.LocalName, ConcatString (endNodes), new System.Diagnostics.StackTrace ());
85
88
                                        break;
86
89
                                case XmlNodeType.Element:
87
90
                                        if (!didReadStartNode && endNodes.Contains (reader.LocalName)) {
91
94
                                        bool validNode = callback (data);
92
95
                                        if (!validNode) 
93
96
                                                LoggingService.LogWarning ("Unknown node: " + reader.LocalName);
94
 
                                        if (data.SkipNextRead) 
95
 
                                                goto skip;
96
97
                                        break;
97
98
                                }
98
99
                        }