Delen via


ExtensionContextExtensions.GetCurrentDocumentSelection<T> Method

Get the subset of the current document selection which is of type T

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams.ExtensionEnablement
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetCurrentDocumentSelection(Of T As Class) ( _
    context As IVsSelectionContext _
) As IEnumerable(Of T)
public static IEnumerable<T> GetCurrentDocumentSelection<T>(
    this IVsSelectionContext context
)
where T : class
[ExtensionAttribute]
public:
generic<typename T>
where T : ref class 
static IEnumerable<T>^ GetCurrentDocumentSelection(
    IVsSelectionContext^ context
)
static member GetCurrentDocumentSelection : 
        context:IVsSelectionContext -> IEnumerable<'T>  when 'T : not struct
JScript does not support generic types or methods.

Type Parameters

  • T
    A type we look instances of in the selection

Parameters

Return Value

Type: System.Collections.Generic.IEnumerable<T>
An enumeration which is a subset of the selected elements of type T

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IVsSelectionContext. 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).

.NET Framework Security

See Also

Reference

ExtensionContextExtensions Class

Microsoft.VisualStudio.Modeling.Diagrams.ExtensionEnablement Namespace