Skip to main content

Analysis

  • 3 minutes to read

This article describes all Context Providers in the Editor | Code | Analysis group. Refer to the Context Providers article for details on how to access Context Providers from the other groups.

A … IsA IsB … Z
ActiveClassCanNotifyPropertyChanged IsBuiltInType
ConstructorHasParameter IsDisposable
DeclaresLocalOfType IsInterfaceType
ExpectingAssignment IsRefType
HasStaticInitializer IsSealedType
HasStaticMember IsValueType
IsAssignmentExist TypeImplements

ActiveClassCanNotifyPropertyChanged

Satisfied if an active class is inherited from the INotifyPropertyChanged interface.

Supported Languages: All

ConstructorHasParameter


[ConstructorHasParameter(typeName)]

Position Parameter Description
1 Type Name The full name of the type (for example, “System.Drawing.Color”).

Satisfied if the specified type’s constructor accepts parameters or has more than one overload.

Supported Languages: C#, Visual Basic

DeclaresLocalOfType


[DeclaresLocalOfType(typeName)]

Position Parameter Description
1 Type Name The full name of the type (for example, “System.Drawing.Color”).

Satisfied if a local variable or parameter in the active method or property matches (or descends from) the specified type.

Supported Languages: C#, Visual Basic

ExpectingAssignment


[ExpectingAssignment]

Satisfied when the caret is on an incomplete assignment statement or inside the value initializer. The example in which this context provider is satisfied is presented below.

int id

Supported Languages: C#, Visual Basic

HasStaticInitializer


[HasStaticInitializer(typeName)]

Position Parameter Description
1 Type Name The full name of the type (for example, “System.Drawing.Color”).

Satisfied if the specified type is a value type and has a static property of the same type (for instance, Empty, MinValue, etc.).

Supported Languages: C#, Visual Basic

HasStaticMember


[HasStaticMember(typeName,memberName)]

Position Parameter Description
1 Type Name The full name of the type (for example, “System.Drawing.Color”).
2 Member Name The name of the member.

Satisfied if the specified type has a static member of the specified name (for instance, “Empty”).

Supported Languages: C#, Visual Basic

IsAssignmentExist


[IsAssignmentExist(typeName)]

Position Parameter Description
1 Type Name The full name of the type (for example, “System.Drawing.Color”).

Satisfied if the assignment on the current line has the specified type.

Supported Languages: C#, Visual Basic

IsBuiltInType


[IsBuiltInType(typeName)]

Position Parameter Description
1 Type Name The type’s full name (for example, “System.Int32” or “int”).

Satisfied if the specified type name is a primitive type.

Supported Languages: C#, Visual Basic

IsDisposable


[IsDisposable(typeName)]

Position Parameter Description
1 Type Name The full name of the type (for example, “System.Resources.IResourceReader”).

Satisfied if the specified type (or an ancestor) implements the IDisposable interface.

Supported Languages: C#, Visual Basic

IsInterfaceType


[IsInterfaceType(typeName)]

Position Parameter Description
1 Type Name The type’s full name (for example, “System.Resources.IResourceReader”).

Satisfied if the specified type is an interface.

Supported Languages: C#, Visual Basic

IsRefType


[IsRefType(typeName)]

Position Parameter Description
1 Type Name The type’s full name.

Satisfied if the specified type is a referenced type.

Supported Languages: C#, Visual Basic

IsSealedType


[IsSealedType(typeName)]

Position Parameter Description
1 Type Name The type’s full name.

Satisfied if the specified type is a sealed type.

Supported Languages: C#, Visual Basic

IsValueType


[IsValueType(typeName)]

Position Parameter Description
1 Type Name The type’s full name.

Satisfied if the specified type is a value type.

Supported Languages: C#, Visual Basic

TypeImplements


[TypeImplements(typeName,interfaceName)]

Position Parameter Description
1 Type Name The full name of the type.
2 Interface Name The interface’s full name (for example, System.Collections.IEnumerable) to test for.

Satisfied if the specified type implements the specified interface. This interface should use its full name (for example, System.Collections.IEnumerable).

Supported Languages: C#, Visual Basic