ModelElementExtensionMethods.RemoveExtension Method (ModelElement, Type)
Remove any extension of this ModelElement that is of a particular type.
Namespace: Microsoft.VisualStudio.Modeling.Extensibility
Assembly: Microsoft.VisualStudio.Modeling.Sdk.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll)
Syntax
'宣言
<ExtensionAttribute> _
Public Shared Function RemoveExtension ( _
element As ModelElement, _
extensionType As Type _
) As Boolean
public static bool RemoveExtension(
this ModelElement element,
Type extensionType
)
[ExtensionAttribute]
public:
static bool RemoveExtension(
ModelElement^ element,
Type^ extensionType
)
static member RemoveExtension :
element:ModelElement *
extensionType:Type -> bool
public static function RemoveExtension(
element : ModelElement,
extensionType : Type
) : boolean
Parameters
- element
Type: Microsoft.VisualStudio.Modeling.ModelElement
The element whose extension is to be removed
- extensionType
Type: System.Type
The type of ExtensionElement to remove
Return Value
Type: System.Boolean
true if an extension of the particular type was found and removed, else false
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type ModelElement. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Note that assuming the Extensions collection is maintained through the Extensibility API then there can be only one extension of a particular type present, so only the first found is removed.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.