Skip to main content

ITypeSymbol Interface Extensions

Extension MethodSummary
BaseTypes(ITypeSymbol)Gets a list of base types of this type.
BaseTypesAndSelf(ITypeSymbol)Gets a list of base types of this type (including this type).
EqualsOrInheritsFrom(ITypeSymbol, ITypeSymbol, Boolean)Returns true if the type is equal or inherits from a specified base type.
EqualsOrInheritsFrom(ITypeSymbol, MetadataName, Boolean)Returns true if the type is equal or inherits from a type with the specified name.
FindMember<TSymbol>(ITypeSymbol, Func<TSymbol, Boolean>)Searches for a member that matches the conditions defined by the specified predicate, if any, and returns the first occurrence within the type's members.
FindMember<TSymbol>(ITypeSymbol, String, Func<TSymbol, Boolean>)Searches for a member that has the specified name and matches the conditions defined by the specified predicate, if any, and returns the first occurrence within the type's members.
GetDefaultValueSyntax(ITypeSymbol, DefaultSyntaxOptions, SymbolDisplayFormat)Creates a new ExpressionSyntax that represents default value of the specified type symbol.
GetDefaultValueSyntax(ITypeSymbol, TypeSyntax, DefaultSyntaxOptions)Creates a new ExpressionSyntax that represents default value of the specified type symbol.
HasAttribute(ITypeSymbol, INamedTypeSymbol, Boolean)Returns true if the type symbol has the specified attribute.
HasAttribute(ITypeSymbol, MetadataName, Boolean)Returns true if the type symbol has attribute with the specified name.
Implements(ITypeSymbol, INamedTypeSymbol, Boolean)Returns true if the type implements specified interface.
Implements(ITypeSymbol, MetadataName, Boolean)Returns true if the type implements specified interface name.
Implements(ITypeSymbol, SpecialType, Boolean)Returns true if the type implements specified interface.
ImplementsAny(ITypeSymbol, SpecialType, SpecialType, Boolean)Returns true if the type implements any of specified interfaces.
ImplementsAny(ITypeSymbol, SpecialType, SpecialType, SpecialType, Boolean)Returns true if the type implements any of specified interfaces.
InheritsFrom(ITypeSymbol, ITypeSymbol, Boolean)Returns true if the type inherits from a specified base type.
InheritsFrom(ITypeSymbol, MetadataName, Boolean)Returns true if the type inherits from a type with the specified name.
IsIEnumerableOfT(ITypeSymbol)Returns true if the type is IEnumerable<T>.
IsIEnumerableOrIEnumerableOfT(ITypeSymbol)Returns true if the type is IEnumerable or IEnumerable<T>.
IsNullableOf(ITypeSymbol, ITypeSymbol)Returns true if the type is Nullable<T> and it has specified type argument.
IsNullableOf(ITypeSymbol, SpecialType)Returns true if the type is Nullable<T> and it has specified type argument.
IsNullableType(ITypeSymbol)Returns true if the type is a nullable type.
IsObject(ITypeSymbol)Returns true if the type is Object.
IsReferenceTypeOrNullableType(ITypeSymbol)Returns true if the type is a reference type or a nullable type.
IsString(ITypeSymbol)Returns true if the type is String.
IsVoid(ITypeSymbol)Returns true if the type is Void.
SupportsConstantValue(ITypeSymbol)Returns true if the specified type can be used to declare constant value.
SupportsExplicitDeclaration(ITypeSymbol)Returns true if the type can be declared explicitly in a source code.
ToMinimalTypeSyntax(ITypeSymbol, SemanticModel, Int32, SymbolDisplayFormat)Creates a new TypeSyntax based on the specified type symbol.
ToTypeSyntax(ITypeSymbol, SymbolDisplayFormat)Creates a new TypeSyntax based on the specified type symbol.