本文整理汇总了C#中IPropertySymbol.GetDocumentationCommentXml方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertySymbol.GetDocumentationCommentXml方法的具体用法?C# IPropertySymbol.GetDocumentationCommentXml怎么用?C# IPropertySymbol.GetDocumentationCommentXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertySymbol
的用法示例。
在下文中一共展示了IPropertySymbol.GetDocumentationCommentXml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadSymbol
protected override void ReadSymbol(IPropertySymbol propertySymbol)
{
// we don't need to know about static members
// because they won't be delegated from child to mixin
if (propertySymbol.IsStatic)
return;
// we ignore private and protected memebers
var hasGetter = propertySymbol.GetMethod != null &&
!(propertySymbol.GetMethod.DeclaredAccessibility == Accessibility.Private ||
propertySymbol.GetMethod.DeclaredAccessibility == Accessibility.Protected);
var hasSetter = propertySymbol.SetMethod != null &&
!(propertySymbol.SetMethod.DeclaredAccessibility == Accessibility.Private ||
propertySymbol.SetMethod.DeclaredAccessibility == Accessibility.Protected);
// property has no accessors or accessors are not accessible => skip property
if (!hasSetter && !hasGetter)
return;
Property property = null;
if (propertySymbol.IsIndexer) // symbol is an indexer property
{
var indexerProperty = new IndexerProperty(
propertySymbol.Type,
hasGetter,
hasSetter);
var parameterReader = new ParameterSymbolReader(indexerProperty);
parameterReader.VisitSymbol(propertySymbol);
property = indexerProperty;
}
else // symbol is a normal property
{
property = new Property(
propertySymbol.Name,
propertySymbol.Type,
hasGetter,
hasSetter);
}
property.IsAbstract = propertySymbol.IsAbstract;
property.IsOverride = propertySymbol.IsOverride;
// store information if accessors are internal,
// we will need this for the generation later
property.IsGetterInternal = hasGetter &&
propertySymbol.GetMethod
.DeclaredAccessibility.HasFlag(Accessibility.Internal);
property.IsSetterInternal = hasSetter &&
propertySymbol.SetMethod
.DeclaredAccessibility.HasFlag(Accessibility.Internal);
property.Documentation = new DocumentationComment(propertySymbol.GetDocumentationCommentXml());
_properties.AddProperty(property);
}