Selection(T, Owner) Class

The Selection class defines a selection of T. Selections consist of zero or more items. The first item in a selection is defined as the "primary" selection, which is used when one object in a group must be used as a key.

Inheritance Hierarchy

System..::..Object
  Microsoft.Data.Tools.Design.Core.Context..::..ContextItem
    Microsoft.Data.Tools.Design.Core.Context..::..Selection<(Of <(<'T, Owner>)>)>

Namespace:  Microsoft.Data.Tools.Design.Core.Context
Assembly:  Microsoft.Data.Tools.Design.Core (in Microsoft.Data.Tools.Design.Core.dll)

Syntax

'Declaration
Public NotInheritable Class Selection(Of T, Owner) _
    Inherits ContextItem _
    Implements IDisposable
'Usage
Dim instance As Selection(Of T, Owner)
public sealed class Selection<T, Owner> : ContextItem, 
    IDisposable
generic<typename T, typename Owner>
public ref class Selection sealed : public ContextItem, 
    IDisposable
[<SealedAttribute>]
type Selection<'T, 'Owner> =  
    class
        inherit ContextItem
        interface IDisposable
    end
JScript does not support generic types and methods.

Type Parameters

  • T
  • Owner

The Selection<(Of <(<'T, Owner>)>)> type exposes the following members.

Constructors

  Name Description
Public method Selection< (Of < ( <'T, Owner> ) > ) >() () () () Creates an empty Selection object.
Public method Selection< (Of < ( <'T, Owner> ) > ) >(IEnumerable< (Of < <' (T> ) > > ), T) Creates a collection object comprising the given selected objects. The first object in the enumeration is considered the "primary" selection.

Top

Properties

  Name Description
Public property Container Gets or sets {insert text here}.
Public property ItemType Override of ContextItem's ItemType property. The ItemType of Selection is always "typeof(Selection)". (Overrides ContextItem..::..ItemType.)
Public property PrimarySelection The primary selection. Some functions require a "key" element. For example, an "align lefts" command needs to know which element's "left" to align to.
Public property SelectedObjects The enumeration of selected objects.
Public property SelectionCount The number of objects that are currently selected into this selection.

Top

Methods

  Name Description
Public methodStatic member AddRemove
Public methodStatic member Clear Clears the selection contained in the editing context.
Public method Dispose
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public methodStatic member GetPrimarySelection
Public methodStatic member GetSelectedObjects
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method OnItemChanged This method is called on a context item before it is stored in the context item manager. The previous item in the context item manager is passed. (Inherited from ContextItem.)
Public methodStatic member RegisterSelectionFilter
Public methodStatic member Replace Selection helper method. This replaces the current selection with a new active set containing only the given items.
Public methodStatic member SelectOnly Selection helper method. This sets itemToSelect into the selection. Any existing items are deselected.
Public methodStatic member SetContainer Set the container object for the selection
Public methodStatic member SetPrimarySelection Set the primary selection to be the specified item
Public methodStatic member Subscribe Helper method that subscribes to selection change events.
Public methodStatic member Toggle 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.
Public method ToString (Inherited from Object.)
Public methodStatic member Unsubscribe Helper method that removes a previously added selection change event.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Data.Tools.Design.Core.Context Namespace