本文整理汇总了C#中IMember.GetMonodocDocumentation方法的典型用法代码示例。如果您正苦于以下问题:C# IMember.GetMonodocDocumentation方法的具体用法?C# IMember.GetMonodocDocumentation怎么用?C# IMember.GetMonodocDocumentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMember
的用法示例。
在下文中一共展示了IMember.GetMonodocDocumentation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDocumentationSummary
public static string GetDocumentationSummary (IMember member)
{
if (member == null)
return null;
if (!string.IsNullOrEmpty (member.Documentation)) {
int idx1 = member.Documentation.IndexOf ("<summary>");
int idx2 = member.Documentation.IndexOf ("</summary>");
string result;
if (idx2 >= 0 && idx1 >= 0) {
result = member.Documentation.Substring (idx1 + "<summary>".Length, idx2 - idx1 - "<summary>".Length);
} else if (idx1 >= 0) {
result = member.Documentation.Substring (idx1 + "<summary>".Length);
} else if (idx2 >= 0) {
result = member.Documentation.Substring (0, idx2 - 1);
} else {
result = member.Documentation;
}
return CleanEmpty (result);
}
XmlElement node = (XmlElement)member.GetMonodocDocumentation ();
if (node != null) {
string innerXml = (node["summary"].InnerXml ?? "").Trim ();
StringBuilder sb = new StringBuilder ();
bool wasWhiteSpace = false;
for (int i = 0; i < innerXml.Length; i++) {
char ch = innerXml[i];
switch (ch) {
case '\n':
case '\r':
break;
default:
bool isWhiteSpace = Char.IsWhiteSpace (ch);
if (isWhiteSpace && wasWhiteSpace)
continue;
wasWhiteSpace = isWhiteSpace;
sb.Append (ch);
break;
}
}
return CleanEmpty (sb.ToString ());
}
return CleanEmpty (member.Documentation);
}
示例2: GetDocumentation
public static string GetDocumentation (IMember member)
{
if (member == null)
return null;
if (!string.IsNullOrEmpty (member.Documentation))
return CleanEmpty (member.Documentation);
XmlElement node = (XmlElement)member.GetMonodocDocumentation ();
if (node != null) {
string result = (node.InnerXml ?? "").Trim ();
return CleanEmpty (result);
}
return null;
}
示例3: AddDocumentation
bool AddDocumentation (IMember member)
{
if (!LoadMonotouchDocumentation)
return false;
try {
var node = member.GetMonodocDocumentation ();
if (node == null)
return true;
string innerXml = (node.InnerXml ?? "").Trim ();
var sb = new StringBuilder ();
bool wasWhiteSpace = false;
for (int i = 0; i < innerXml.Length; i++) {
char ch = innerXml [i];
switch (ch) {
case '\n':
case '\r':
break;
default:
bool isWhiteSpace = Char.IsWhiteSpace (ch);
if (isWhiteSpace && wasWhiteSpace)
continue;
wasWhiteSpace = isWhiteSpace;
sb.Append (ch);
break;
}
}
member.Documentation = sb.ToString ();
return true;
} catch (Exception) {
LoadMonotouchDocumentation = false;
return false;
}
}