Table of Contents

Class GeoCollection<T>

Namespace
ThinkGeo.Core
Assembly
ThinkGeo.Core.dll

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
GeoCollection<T>
Implements
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 string

This parameter is the key to find the item.

item T

This 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 T

This 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 string

This 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 int

The zero-based index at which item should be inserted.

key string

The key to find the item.

item T

The 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 int

The zero-based index at which item should be inserted.

item T

The 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 int
item T

MoveDown(int)

This method moves an item down in the collection.

public void MoveDown(int index)

Parameters

index int

This 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 string

This 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 T

This 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 int

This parameter is the index of the item you want move from in the collection.

toIndex int

This 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 string

This parameter is the key of item you want to move in the collection.

toIndex int

This 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 T

This parameter is the item you want to move in the collection.

toIndex int

This 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 int

This 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 string

This 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 T

This 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 int

This 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 string

This 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 T

This 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 int

This 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 string

This 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 T

This parameter is the item you want to move up in the collection.

Remarks

None

OnAdded(AddedGeoCollectionEventArgs)

protected virtual void OnAdded(AddedGeoCollectionEventArgs e)

Parameters

e AddedGeoCollectionEventArgs

OnAdding(AddingGeoCollectionEventArgs)

protected virtual void OnAdding(AddingGeoCollectionEventArgs e)

Parameters

e AddingGeoCollectionEventArgs

OnClearedItems(ClearedItemsGeoCollectionEventArgs)

protected virtual void OnClearedItems(ClearedItemsGeoCollectionEventArgs e)

Parameters

e ClearedItemsGeoCollectionEventArgs

OnClearingItems(ClearingItemsGeoCollectionEventArgs)

protected virtual void OnClearingItems(ClearingItemsGeoCollectionEventArgs e)

Parameters

e ClearingItemsGeoCollectionEventArgs

OnCollectionChanged(NotifyCollectionChangedEventArgs)

protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

Parameters

e NotifyCollectionChangedEventArgs

OnInserted(InsertedGeoCollectionEventArgs)

protected virtual void OnInserted(InsertedGeoCollectionEventArgs e)

Parameters

e InsertedGeoCollectionEventArgs

OnInserting(InsertingGeoCollectionEventArgs)

protected virtual void OnInserting(InsertingGeoCollectionEventArgs e)

Parameters

e InsertingGeoCollectionEventArgs

OnMovedItem(MovedItemGeoCollectionEventArgs)

protected virtual void OnMovedItem(MovedItemGeoCollectionEventArgs e)

Parameters

e MovedItemGeoCollectionEventArgs

OnPropertyChanged(PropertyChangedEventArgs)

protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)

Parameters

e PropertyChangedEventArgs

OnRemoved(RemovedGeoCollectionEventArgs)

protected virtual void OnRemoved(RemovedGeoCollectionEventArgs e)

Parameters

e RemovedGeoCollectionEventArgs

OnRemoving(RemovingGeoCollectionEventArgs)

protected virtual void OnRemoving(RemovingGeoCollectionEventArgs e)

Parameters

e RemovingGeoCollectionEventArgs

Remove(string)

This method removes an item from the collection based on the specified key.

public void Remove(string key)

Parameters

key string

This 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 int

This 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 int

This parameter is the index of the item you want to set.

item T

This parameter is the item you want to set.

Remarks

None

Events

Added

public event EventHandler<AddedGeoCollectionEventArgs> Added

Event Type

EventHandler<AddedGeoCollectionEventArgs>

Adding

public event EventHandler<AddingGeoCollectionEventArgs> Adding

Event Type

EventHandler<AddingGeoCollectionEventArgs>

ClearedItems

public event EventHandler<ClearedItemsGeoCollectionEventArgs> ClearedItems

Event Type

EventHandler<ClearedItemsGeoCollectionEventArgs>

ClearingItems

public event EventHandler<ClearingItemsGeoCollectionEventArgs> ClearingItems

Event Type

EventHandler<ClearingItemsGeoCollectionEventArgs>

CollectionChanged

public event NotifyCollectionChangedEventHandler CollectionChanged

Event Type

NotifyCollectionChangedEventHandler

Inserted

public event EventHandler<InsertedGeoCollectionEventArgs> Inserted

Event Type

EventHandler<InsertedGeoCollectionEventArgs>

Inserting

public event EventHandler<InsertingGeoCollectionEventArgs> Inserting

Event Type

EventHandler<InsertingGeoCollectionEventArgs>

MovedItem

public event EventHandler<MovedItemGeoCollectionEventArgs> MovedItem

Event Type

EventHandler<MovedItemGeoCollectionEventArgs>

PropertyChanged

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler

Removed

public event EventHandler<RemovedGeoCollectionEventArgs> Removed

Event Type

EventHandler<RemovedGeoCollectionEventArgs>

Removing

public event EventHandler<RemovingGeoCollectionEventArgs> Removing

Event Type

EventHandler<RemovingGeoCollectionEventArgs>