C# Class SIL.FieldWorks.Common.Widgets.FwListBox.ObjectCollection

Like ListBox, FwListBox defines an ObjectCollection class for the items in the list. This class provides a subset of the functionality of the ArrayList used to implement it. The reason for not using an ArrayList is that operations that change the contents of the list have to have side effects on the control.
Inheritance: IList, ICollection, IEnumerable, IFWDisposable
Mostra file Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
ClearAllItems void
ICollection void

Public Methods

Method Description
Add ( object item ) : int

Add an item to the collection and the display.

AddRange ( IEnumerable items ) : void

Add a whole collection of objects.

CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

Clear ( ) : void

Clear all items.

Enhance JohnT: add the version that takes an ObjectCollection.

Contains ( object item ) : bool

See if the item is present.

Dispose ( ) : void

Must not be virtual.

GetEnumerator ( ) : IEnumerator

Get an enumerator for the list.

IndexOf ( object item ) : int

Find the zero-based position of the item, or -1 if not found.

Insert ( int index, object item ) : void

Insert the specified item at the specified position.

ObjectCollection ( IFwListBox owner ) : System

Construct empty.

ObjectCollection ( IFwListBox owner, object values ) : System

Construct with supplied initial items.

Remove ( object item ) : void

RemoveAt ( int index ) : void

this ( int index ) : object

Indexer. Set must modify the display.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.

If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.

InsertItemAtIndex ( int index, object item ) : void

Shared function for Insert and Add.

Private Methods

Method Description
ClearAllItems ( ) : void
ICollection ( Array dest, int arrayIndex ) : void

Copy to a destination array.

Method Details

Add() public method

Add an item to the collection and the display.
public Add ( object item ) : int
item object
return int

AddRange() public method

Add a whole collection of objects.
public AddRange ( IEnumerable items ) : void
items IEnumerable
return void

CheckDisposed() public method

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
return void

Clear() public method

Clear all items.
Enhance JohnT: add the version that takes an ObjectCollection.
public Clear ( ) : void
return void

Contains() public method

See if the item is present.
public Contains ( object item ) : bool
item object
return bool

Dispose() public method

Must not be virtual.
public Dispose ( ) : void
return void

Dispose() protected method

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.
If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetEnumerator() public method

Get an enumerator for the list.
public GetEnumerator ( ) : IEnumerator
return IEnumerator

IndexOf() public method

Find the zero-based position of the item, or -1 if not found.
public IndexOf ( object item ) : int
item object
return int

Insert() public method

Insert the specified item at the specified position.
public Insert ( int index, object item ) : void
index int
item object
return void

InsertItemAtIndex() protected method

Shared function for Insert and Add.
protected InsertItemAtIndex ( int index, object item ) : void
index int
item object
return void

ObjectCollection() public method

Construct empty.
public ObjectCollection ( IFwListBox owner ) : System
owner IFwListBox
return System

ObjectCollection() public method

Construct with supplied initial items.
public ObjectCollection ( IFwListBox owner, object values ) : System
owner IFwListBox
values object
return System

Remove() public method

public Remove ( object item ) : void
item object
return void

RemoveAt() public method

public RemoveAt ( int index ) : void
index int
return void

this() public method

Indexer. Set must modify the display.
public this ( int index ) : object
index int
return object