本文整理汇总了C#中Symbol.IsIndexedProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Symbol.IsIndexedProperty方法的具体用法?C# Symbol.IsIndexedProperty怎么用?C# Symbol.IsIndexedProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol.IsIndexedProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReportAccessorOfInterfacePropertyOrEvent
/// <summary>
/// It's not interesting to report diagnostics on implementation of interface accessors
/// if the corresponding events or properties are not implemented (i.e. we want to suppress
/// cascading diagnostics).
/// Caveat: Indexed property accessors are always interesting.
/// Caveat: It's also uninteresting if a WinRT event is implemented by a non-WinRT event,
/// or vice versa.
/// </summary>
private bool ReportAccessorOfInterfacePropertyOrEvent(Symbol interfacePropertyOrEvent)
{
Debug.Assert((object)interfacePropertyOrEvent != null);
// Accessors of indexed properties are always interesting.
if (interfacePropertyOrEvent.IsIndexedProperty())
{
return true;
}
Symbol implementingPropertyOrEvent = this.FindImplementationForInterfaceMemberWithDiagnostics(interfacePropertyOrEvent).Symbol;
// If the property or event wasn't implemented, then we'd prefer to report diagnostics about that.
if ((object)implementingPropertyOrEvent == null)
{
return false;
}
// If the property or event was an event and was implemented, but the WinRT-ness didn't agree,
// then we'd prefer to report diagnostics about that.
if (interfacePropertyOrEvent.Kind == SymbolKind.Event && implementingPropertyOrEvent.Kind == SymbolKind.Event &&
((EventSymbol)interfacePropertyOrEvent).IsWindowsRuntimeEvent != ((EventSymbol)implementingPropertyOrEvent).IsWindowsRuntimeEvent)
{
return false;
}
return true;
}