MethodSymbolExtensions Class
internal static class MethodSymbolExtensionsNo documentation is available.
Methods
| Name | Description |
|---|---|
| GetImplementedInterfaceMember(IEventSymbol) | |
| GetImplementedInterfaceMember(IMethodSymbol) | |
| GetImplementedInterfaceMember(IPropertySymbol) | |
| GetReturnTypeAttribute(IMethodSymbol, ITypeSymbol?, bool) | Gets the first return type attribute of method that matches attributeType. Only the attributes applied to the return type of method are considered. Unlike Attribute.GetCustomAttributes(inherit: true), the methods overridden by method are never inspected. |
| HasReturnTypeAttribute(IMethodSymbol, ITypeSymbol?, bool) | Indicates whether the return type of method has an attribute matching attributeType. Only the attributes applied to the return type of method are considered. Unlike Attribute.GetCustomAttributes(inherit: true), the methods overridden by method are never inspected. |
| IsInterfaceImplementation(IEventSymbol) | |
| IsInterfaceImplementation(IMethodSymbol) | |
| IsInterfaceImplementation(IPropertySymbol) | |
| IsOrOverrides(IMethodSymbol?, IMethodSymbol?) | |
| IsPrimaryConstructor(IMethodSymbol?, CancellationToken, bool) | |
| Overrides(IMethodSymbol?, ISymbol?) |
GetImplementedInterfaceMember overloads
GetImplementedInterfaceMember(IEventSymbol)
public static IEventSymbol? GetImplementedInterfaceMember(this IEventSymbol symbol)No documentation is available.
GetImplementedInterfaceMember(IMethodSymbol)
public static IMethodSymbol? GetImplementedInterfaceMember(this IMethodSymbol symbol)No documentation is available.
GetImplementedInterfaceMember(IPropertySymbol)
public static IPropertySymbol? GetImplementedInterfaceMember(this IPropertySymbol symbol)No documentation is available.
GetReturnTypeAttribute(IMethodSymbol, ITypeSymbol?, bool)
Gets the first return type attribute of method that matches attributeType. Only the attributes applied to the return type of method are considered. Unlike Attribute.GetCustomAttributes(inherit: true), the methods overridden by method are never inspected.
public static AttributeData? GetReturnTypeAttribute(this IMethodSymbol method, ITypeSymbol? attributeType, bool inherits = true)Parameters
methodIMethodSymbol- The method whose return type attributes are inspected.
attributeTypeITypeSymbol?- The type of the attribute to look for. When
null, no attribute is returned. inheritsbool- When
true, an attribute also matches when its class derives fromattributeType. Whenfalse, the attribute class must be exactlyattributeType. This parameter is ignored whenattributeTypeis sealed, as no other class can derive from it. Note this is unrelated to theinheritparameter ofAttribute.GetCustomAttributes: it never makes the methods overridden bymethodbe inspected.
Returns
AttributeData? The first matching attribute, or null when the return type of method has no matching attribute.
HasReturnTypeAttribute(IMethodSymbol, ITypeSymbol?, bool)
Indicates whether the return type of method has an attribute matching attributeType. Only the attributes applied to the return type of method are considered. Unlike Attribute.GetCustomAttributes(inherit: true), the methods overridden by method are never inspected.
public static bool HasReturnTypeAttribute(this IMethodSymbol method, ITypeSymbol? attributeType, bool inherits = true)Parameters
methodIMethodSymbol- The method whose return type attributes are inspected.
attributeTypeITypeSymbol?- The type of the attribute to look for. When
null, the method returnsfalse. inheritsbool- When
true, an attribute also matches when its class derives fromattributeType. Whenfalse, the attribute class must be exactlyattributeType. This parameter is ignored whenattributeTypeis sealed, as no other class can derive from it. Note this is unrelated to theinheritparameter ofAttribute.GetCustomAttributes: it never makes the methods overridden bymethodbe inspected.
Returns
bool true when the return type of method has a matching attribute; otherwise false.
IsInterfaceImplementation overloads
IsInterfaceImplementation(IEventSymbol)
public static bool IsInterfaceImplementation(this IEventSymbol symbol)No documentation is available.
IsInterfaceImplementation(IMethodSymbol)
public static bool IsInterfaceImplementation(this IMethodSymbol symbol)No documentation is available.
IsInterfaceImplementation(IPropertySymbol)
public static bool IsInterfaceImplementation(this IPropertySymbol symbol)No documentation is available.
IsOrOverrides(IMethodSymbol?, IMethodSymbol?)
public static bool IsOrOverrides(this IMethodSymbol? symbol, IMethodSymbol? baseMethod)No documentation is available.
IsPrimaryConstructor(IMethodSymbol?, CancellationToken, bool)
public static bool IsPrimaryConstructor(this IMethodSymbol? methodSymbol, CancellationToken cancellationToken, bool includeRecordDeclarations = false)Parameters
methodSymbolIMethodSymbol?cancellationTokenCancellationTokenincludeRecordDeclarationsbool
Returns
No documentation is available.
Overrides(IMethodSymbol?, ISymbol?)
public static bool Overrides(this IMethodSymbol? symbol, ISymbol? baseSymbol)No documentation is available.