Toggle Method
Selection helper method. This takes the existing selection in the context and creates a new selection that contains the toggled state of the item. If the item is to be added to the selection, it is added as the primary selection.
Namespace: Microsoft.Data.Tools.Design.Core.Context
Assembly: Microsoft.Data.Tools.Design.Core (in Microsoft.Data.Tools.Design.Core.dll)
Syntax
'Declaration
Public Shared Function Toggle ( _
context As EditingContext, _
itemToToggle As T _
) As Selection(Of T, Owner)
'Usage
Dim context As EditingContext
Dim itemToToggle As T
Dim returnValue As Selection(Of T, Owner)
returnValue = Selection.Toggle(context, _
itemToToggle)
public static Selection<T, Owner> Toggle(
EditingContext context,
T itemToToggle
)
public:
static Selection<T, Owner>^ Toggle(
EditingContext^ context,
T itemToToggle
)
static member Toggle :
context:EditingContext *
itemToToggle:'T -> Selection<'T, 'Owner>
public static function Toggle(
context : EditingContext,
itemToToggle : T
) : Selection<T, Owner>
Parameters
- context
Type: Microsoft.Data.Tools.Design.Core.Context..::..EditingContext
The editing context to apply this selection change to.
- itemToToggle
Type: T
The item to toggle selection for.
Return Value
Type: Microsoft.Data.Tools.Design.Core.Context..::..Selection< (Of < ( <'T, Owner> ) > ) >
A Selection object that contains the new selection.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | If context or itemToToggle is null. |