Class GeoCollection<T>
This class is a collection with some methods specialized for dealing with Layers and other spatial classes.
public class GeoCollection<T> : Collection<T>, IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged
Type Parameters
T
This parameter is the item you want a collection of.
- Inheritance
-
Collection<T>GeoCollection<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Inherited Members
Remarks
We have added some helpful methods like MoveUp, MoveDown, etc. These help when you are manipulating Layers.
Constructors
GeoCollection()
This is the default constructor for the class.
public GeoCollection()
Remarks
None
Properties
this[string]
This property gets and sets the object.
public T this[string key] { get; set; }
Parameters
key
string
Property Value
- T
Remarks
None
Methods
Add(string, T)
This method adds an item to the collection by specifying the item and a key.
public void Add(string key, T item)
Parameters
key
stringThis parameter is the key to find the item.
item
TThis parameter is the item you want added to the collection.
Remarks
None
Add(T)
This method adds an item to the collection.
public void Add(T item)
Parameters
item
TThis parameter is the item you want added to the collection.
Remarks
This method adds an item to the collection, and the item's key will be a random GUID.
ClearItems()
This method clears the items from the collection.
protected override void ClearItems()
Remarks
None
Contains(string)
This method returns whether an item is in the collection based on the specified key.
public bool Contains(string key)
Parameters
key
stringThis parameter is the key of the item you are searching for.
Returns
- bool
This method returns whether an item is in the collection based on the specified key.
Remarks
None
GetKeys()
This method returns a collection of the keys in the collection.
public Collection<string> GetKeys()
Returns
- Collection<string>
This method returns a collection of the keys in the collection.
Remarks
None
Insert(int, string, T)
Inserts an element into the System.Collections.ObjectModel.Collection<T> at the specified index and key.
public void Insert(int index, string key, T item)
Parameters
index
intThe zero-based index at which item should be inserted.
key
stringThe key to find the item.
item
TThe object to insert. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
index is less than zero. -or- index is greater than System.Collections.ObjectModel.Collection<T>.Count.
Insert(int, T)
Inserts an element into the System.Collections.ObjectModel.Collection<T> at the specified index.
public void Insert(int index, T item)
Parameters
index
intThe zero-based index at which item should be inserted.
item
TThe object to insert. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
index is less than zero. -or- index is greater than System.Collections.ObjectModel.Collection<T>.Count.
InsertItem(int, T)
protected override void InsertItem(int index, T item)
Parameters
index
intitem
T
MoveDown(int)
This method moves an item down in the collection.
public void MoveDown(int index)
Parameters
index
intThis parameter is the index of the item in the collection.
Remarks
None
MoveDown(string)
This method moves an item down in the collection.
public void MoveDown(string key)
Parameters
key
stringThis parameter is the key of the item in the dictionary.
Remarks
None
MoveDown(T)
This method moves an item down in the collection.
public void MoveDown(T item)
Parameters
item
TThis parameter is the item you want to move down in the dictionary.
Remarks
None
MoveTo(int, int)
This method moves the item at fromIndex to the location of toIndex in the collection.
public void MoveTo(int fromIndex, int toIndex)
Parameters
fromIndex
intThis parameter is the index of the item you want move from in the collection.
toIndex
intThis parameter is the target index that you want to move the item to in the collection.
Remarks
This method moves the item at fromIndex to the location of toIndex in the collection.
MoveTo(string, int)
This method moves the item with the key you specified to the location of toIndex in the collection.
public void MoveTo(string key, int toIndex)
Parameters
key
stringThis parameter is the key of item you want to move in the collection.
toIndex
intThis parameter is the target index that you want to move the item to in the collection.
Remarks
This method moves the item with the key you specified to the location of toIndex in the collection.
MoveTo(T, int)
This method moves the item you specified to the location of toIndex in the collection.
public void MoveTo(T item, int toIndex)
Parameters
item
TThis parameter is the item you want to move in the collection.
toIndex
intThis parameter is the target index that you want to move the item to in the collection.
Remarks
This method moves the item you specified to the location of toIndex in the collection.
MoveToBottom(int)
This method moves the item at the specified index to the bottom of the collection.
public void MoveToBottom(int index)
Parameters
index
intThis parameter is the index of the item you want move to the bottom of the collection.
Remarks
This method moves the item at the specified index to the bottom of the collection.
MoveToBottom(string)
This method moves the item with the specified key to the bottom of the collection.
public void MoveToBottom(string key)
Parameters
key
stringThis parameter is the key of the item you want move to the bottom of the collection.
Remarks
This method moves the item with the specified key to the bottom of the collection.
MoveToBottom(T)
This method moves the item specified key to the bottom of the collection.
public void MoveToBottom(T item)
Parameters
item
TThis parameter is the item you want move to the bottom of the collection.
Remarks
This method moves the item specified key to the bottom of the collection.
MoveToTop(int)
This method moves the item at the specified index to the top of the collection.
public void MoveToTop(int index)
Parameters
index
intThis parameter is the index of the item you want move to the top of the collection.
Remarks
This method moves the item at the specified index to the top of the collection.
MoveToTop(string)
This method moves the item with the specified key to the top of the collection.
public void MoveToTop(string key)
Parameters
key
stringThis parameter is the key of the item you want move to the top of the collection.
Remarks
This method moves the item with the specified key to the top of the collection.
MoveToTop(T)
This method moves the item specified to the top of the collection.
public void MoveToTop(T item)
Parameters
item
TThis parameter is the item you want move to the top of the collection.
Remarks
This method moves the item specified to the top of the collection.
MoveUp(int)
This method moves an item up in the collection.
public void MoveUp(int index)
Parameters
index
intThis parameter is the index of the item in the collection.
Remarks
None
MoveUp(string)
This method moves an item up in the collection.
public void MoveUp(string key)
Parameters
key
stringThis parameter is the key of the item in the collection.
Remarks
None
MoveUp(T)
This method moves an item up in the collection.
public void MoveUp(T item)
Parameters
item
TThis parameter is the item you want to move up in the collection.
Remarks
None
OnAdded(AddedGeoCollectionEventArgs)
protected virtual void OnAdded(AddedGeoCollectionEventArgs e)
Parameters
OnAdding(AddingGeoCollectionEventArgs)
protected virtual void OnAdding(AddingGeoCollectionEventArgs e)
Parameters
OnClearedItems(ClearedItemsGeoCollectionEventArgs)
protected virtual void OnClearedItems(ClearedItemsGeoCollectionEventArgs e)
Parameters
OnClearingItems(ClearingItemsGeoCollectionEventArgs)
protected virtual void OnClearingItems(ClearingItemsGeoCollectionEventArgs e)
Parameters
OnCollectionChanged(NotifyCollectionChangedEventArgs)
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
OnInserted(InsertedGeoCollectionEventArgs)
protected virtual void OnInserted(InsertedGeoCollectionEventArgs e)
Parameters
OnInserting(InsertingGeoCollectionEventArgs)
protected virtual void OnInserting(InsertingGeoCollectionEventArgs e)
Parameters
OnMovedItem(MovedItemGeoCollectionEventArgs)
protected virtual void OnMovedItem(MovedItemGeoCollectionEventArgs e)
Parameters
OnPropertyChanged(PropertyChangedEventArgs)
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Parameters
OnRemoved(RemovedGeoCollectionEventArgs)
protected virtual void OnRemoved(RemovedGeoCollectionEventArgs e)
Parameters
OnRemoving(RemovingGeoCollectionEventArgs)
protected virtual void OnRemoving(RemovingGeoCollectionEventArgs e)
Parameters
Remove(string)
This method removes an item from the collection based on the specified key.
public void Remove(string key)
Parameters
key
stringThis parameter is the key of the item you want to remove.
Remarks
None
RemoveItem(int)
This method removes an item from the collection based on the specified index.
protected override void RemoveItem(int index)
Parameters
index
intThis parameter is the index of the item you want to remove.
Remarks
None
SetItem(int, T)
This method allows you to set an item based on the index.
protected override void SetItem(int index, T item)
Parameters
index
intThis parameter is the index of the item you want to set.
item
TThis parameter is the item you want to set.
Remarks
None
Events
Added
public event EventHandler<AddedGeoCollectionEventArgs> Added
Event Type
Adding
public event EventHandler<AddingGeoCollectionEventArgs> Adding
Event Type
ClearedItems
public event EventHandler<ClearedItemsGeoCollectionEventArgs> ClearedItems
Event Type
ClearingItems
public event EventHandler<ClearingItemsGeoCollectionEventArgs> ClearingItems
Event Type
CollectionChanged
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
Inserted
public event EventHandler<InsertedGeoCollectionEventArgs> Inserted
Event Type
Inserting
public event EventHandler<InsertingGeoCollectionEventArgs> Inserting
Event Type
MovedItem
public event EventHandler<MovedItemGeoCollectionEventArgs> MovedItem
Event Type
PropertyChanged
public event PropertyChangedEventHandler PropertyChanged
Event Type
Removed
public event EventHandler<RemovedGeoCollectionEventArgs> Removed
Event Type
Removing
public event EventHandler<RemovingGeoCollectionEventArgs> Removing