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
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Свойство Type Description
ClearAllItems void
ICollection void

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode Description
ClearAllItems ( ) : void
ICollection ( Array dest, int arrayIndex ) : void

Copy to a destination array.

Method Details

Add() public méthode

Add an item to the collection and the display.
public Add ( object item ) : int
item object
Résultat int

AddRange() public méthode

Add a whole collection of objects.
public AddRange ( IEnumerable items ) : void
items IEnumerable
Résultat void

CheckDisposed() public méthode

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

Clear() public méthode

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

Contains() public méthode

See if the item is present.
public Contains ( object item ) : bool
item object
Résultat bool

Dispose() public méthode

Must not be virtual.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

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
Résultat void

GetEnumerator() public méthode

Get an enumerator for the list.
public GetEnumerator ( ) : IEnumerator
Résultat IEnumerator

IndexOf() public méthode

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

Insert() public méthode

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

InsertItemAtIndex() protected méthode

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

ObjectCollection() public méthode

Construct empty.
public ObjectCollection ( IFwListBox owner ) : System
owner IFwListBox
Résultat System

ObjectCollection() public méthode

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

Remove() public méthode

public Remove ( object item ) : void
item object
Résultat void

RemoveAt() public méthode

public RemoveAt ( int index ) : void
index int
Résultat void

this() public méthode

Indexer. Set must modify the display.
public this ( int index ) : object
index int
Résultat object