C# Class WPF.JoshSmith.Panels.DisconnectedUIElementCollection

Inheritance: System.Windows.Controls.UIElementCollection, INotifyCollectionChanged
Exibir arquivo Open project: Warewolf-ESB/Warewolf Class Usage Examples

Public Methods

Method Description
Add ( UIElement element ) : int

Adds the element to the DisconnectedUIElementCollection

Clear ( ) : void

Removes all elements from the DisconnectedUIElementCollection

Contains ( UIElement element ) : bool

Determines whether an element is in the DisconnectedUIElementCollection

CopyTo ( Array array, int index ) : void

Copies the collection into the Array

CopyTo ( UIElement array, int index ) : void

Strongly typed version of CopyTo

DisconnectedUIElementCollection ( UIElement owner ) : System

This collection can be used by a panel to maintain a collection of child elements that are *not* connected to their owner as visual children or logical children.

GetEnumerator ( ) : IEnumerator

Returns an enumerator that can iterate through the collection.

IndexOf ( UIElement element ) : int

Returns the index of the element in the DisconnectedUIElementCollection

Initialize ( ) : void

The Initialize method is simply exposed as an accessible member that can be called from the ConceptualPanel's Loaded event. Accessing this member via the Children property will implicitly cause CreateUIElementCollection to be called to create the disconnected collection. This method exists because simple access of a property like Count might be optimized away by an aggressive compiler.

Insert ( int index, UIElement element ) : void

Inserts an element into the DisconnectedUIElementCollection at the specified index

Remove ( UIElement element ) : void

Removes the specified element from the DisconnectedUIElementCollection

RemoveAt ( int index ) : void

Removes the element at the specified index from the DisconnectedUIElementCollection

RemoveRange ( int index, int count ) : void

Removes the specified number of elements starting at the specified index from the DisconnectedUIElementCollection

this ( int index ) : UIElement

Private Methods

Method Description
BaseIndexOf ( UIElement element ) : int
BaseInsert ( int index, UIElement element ) : void
BaseRemoveAt ( int index ) : void
DisconnectedUIElementCollection ( UIElement owner, SurrogateVisualParent surrogateVisualParent ) : System
RaiseCollectionChanged ( NotifyCollectionChangedAction action, object changedItem, int index ) : void
VerifyWriteAccess ( ) : void

If the owner is an items host, we need to enforce the rule that elements cannot be explicitly added to the disconnected collection. However, it is still possible to modify the visual or logical "connected" children of a ConceptualPanel while it is an items host by simply calling the AddVisualChild, RemoveVisualChild, AddLogicalChild, or RemoveLogicalChild methods. Logic within ConceptualPanel ensures that any visual children added in this manner will be returned within a GetVisualChild() enumeration.

Method Details

Add() public method

Adds the element to the DisconnectedUIElementCollection
public Add ( UIElement element ) : int
element UIElement
return int

Clear() public method

Removes all elements from the DisconnectedUIElementCollection
public Clear ( ) : void
return void

Contains() public method

Determines whether an element is in the DisconnectedUIElementCollection
public Contains ( UIElement element ) : bool
element UIElement
return bool

CopyTo() public method

Copies the collection into the Array
public CopyTo ( Array array, int index ) : void
array System.Array
index int
return void

CopyTo() public method

Strongly typed version of CopyTo
public CopyTo ( UIElement array, int index ) : void
array UIElement
index int
return void

DisconnectedUIElementCollection() public method

This collection can be used by a panel to maintain a collection of child elements that are *not* connected to their owner as visual children or logical children.
public DisconnectedUIElementCollection ( UIElement owner ) : System
owner UIElement
return System

GetEnumerator() public method

Returns an enumerator that can iterate through the collection.
public GetEnumerator ( ) : IEnumerator
return IEnumerator

IndexOf() public method

Returns the index of the element in the DisconnectedUIElementCollection
public IndexOf ( UIElement element ) : int
element UIElement
return int

Initialize() public method

The Initialize method is simply exposed as an accessible member that can be called from the ConceptualPanel's Loaded event. Accessing this member via the Children property will implicitly cause CreateUIElementCollection to be called to create the disconnected collection. This method exists because simple access of a property like Count might be optimized away by an aggressive compiler.
public Initialize ( ) : void
return void

Insert() public method

Inserts an element into the DisconnectedUIElementCollection at the specified index
public Insert ( int index, UIElement element ) : void
index int
element UIElement
return void

Remove() public method

Removes the specified element from the DisconnectedUIElementCollection
public Remove ( UIElement element ) : void
element UIElement
return void

RemoveAt() public method

Removes the element at the specified index from the DisconnectedUIElementCollection
public RemoveAt ( int index ) : void
index int
return void

RemoveRange() public method

Removes the specified number of elements starting at the specified index from the DisconnectedUIElementCollection
public RemoveRange ( int index, int count ) : void
index int
count int
return void

this() public method

public this ( int index ) : UIElement
index int
return UIElement