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

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Output/AmbienceService.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:
153
153
                {
154
154
                        if (member == null)
155
155
                                return null;
156
 
                        if (!string.IsNullOrEmpty (member.Documentation)) {
157
 
                                int idx1 = member.Documentation.IndexOf ("<summary>");
158
 
                                int idx2 = member.Documentation.IndexOf ("</summary>");
 
156
                        string documentation = member.SourceProjectDom.GetDocumentation (member);
 
157
                        
 
158
                        if (!string.IsNullOrEmpty (documentation)) {
 
159
                                int idx1 = documentation.IndexOf ("<summary>");
 
160
                                int idx2 = documentation.IndexOf ("</summary>");
159
161
                                string result;
160
162
                                if (idx2 >= 0 && idx1 >= 0) {
161
 
                                        result = member.Documentation.Substring (idx1 + "<summary>".Length, idx2 - idx1 - "<summary>".Length);
 
163
                                        result = documentation.Substring (idx1 + "<summary>".Length, idx2 - idx1 - "<summary>".Length);
162
164
                                } else if (idx1 >= 0) {
163
 
                                        result = member.Documentation.Substring (idx1 + "<summary>".Length);
 
165
                                        result = documentation.Substring (idx1 + "<summary>".Length);
164
166
                                } else if (idx2 >= 0) {
165
 
                                        result = member.Documentation.Substring (0, idx2 - 1);
 
167
                                        result = documentation.Substring (0, idx2 - 1);
166
168
                                } else {
167
 
                                        result = member.Documentation;
 
169
                                        result = documentation;
168
170
                                }
 
171
                                
169
172
                                return CleanEmpty (result);
170
173
                        }
 
174
                        
171
175
                        XmlElement node = (XmlElement)member.GetMonodocDocumentation ();
172
176
                        if (node != null) {
173
177
                                string innerXml = (node["summary"].InnerXml ?? "").Trim ();
188
192
                                                break;
189
193
                                        }
190
194
                                }
 
195
                                
 
196
                        
191
197
                                return CleanEmpty (sb.ToString ());
192
198
                        }
193
 
                        
194
 
                        return CleanEmpty (member.Documentation);
 
199
                        return CleanEmpty (documentation);
195
200
                }
196
201
                
197
202
                static string CleanEmpty (string doc)
382
387
                {
383
388
                        if (string.IsNullOrEmpty (doc))
384
389
                                return null;
385
 
                        
386
390
                        System.IO.StringReader reader = new System.IO.StringReader ("<docroot>" + doc + "</docroot>");
387
391
                        XmlTextReader xml = new XmlTextReader (reader);
388
392
                        StringBuilder ret = new StringBuilder (70);
477
481
                        
478
482
                        } catch (Exception ex) {
479
483
                                MonoDevelop.Core.LoggingService.LogError (ex.ToString ());
480
 
                                return doc;
 
484
                                return EscapeText (doc);
481
485
                        }
482
486
                        if (IsEmptyDocumentation (ret.ToString ()))
483
487
                                return null;