Table of Contents

Class ProjectItemCollection

Namespace
Loehnert.Lisrt.Scripting.Project
Assembly
Loehnert.Lisrt.Scripting.dll

A observable collection for IProjectItems.

public class ProjectItemCollection : IProjectItemCollection, ICollection<IProjectItem>, IEnumerable<IProjectItem>, IEnumerable, INotifyCollectionChanged
Inheritance
ProjectItemCollection
Implements
Inherited Members

Constructors

ProjectItemCollection(ICompositeProjectItem)

Initializes a new instance of the ProjectItemCollection class.

public ProjectItemCollection(ICompositeProjectItem projectItem)

Parameters

projectItem ICompositeProjectItem

The IProjectItem where the collection belongs to.

Exceptions

ArgumentNullException

Thrown when projectItem is null.

ProjectItemCollection(ICompositeProjectItem, params IProjectItem[])

Initializes a new instance of the ProjectItemCollection class and adds subProjectItems.

public ProjectItemCollection(ICompositeProjectItem projectItem, params IProjectItem[] subProjectItems)

Parameters

projectItem ICompositeProjectItem

The IProjectItem instance the collection belongs to.

subProjectItems IProjectItem[]

IProjectItems which will be added while construction.

Exceptions

ArgumentNullException

Thrown when projectItem or subProjectItems is null.

Properties

Count

Gets the number of elements.

public int Count { get; }

Property Value

int

IsReadOnly

Gets a value indicating whether the ProjectItemCollection is read-only.

public virtual bool IsReadOnly { get; }

Property Value

bool

Methods

Add(IProjectItem)

Adds an IProjectItem item.

public void Add(IProjectItem projectItem)

Parameters

projectItem IProjectItem

The IProjectItem which should be added.

Exceptions

ArgumentNullException

Thrown when projectItem is null.

NotSupportedException

Thrown when the collection is read only.

ArgumentException

Thrown when the collection already contains a IProjectItem instance with the name of projectItem.

AddNonRemovable(IProjectItem)

Adds an IProjectItem item which is not removable.

public void AddNonRemovable(IProjectItem projectItem)

Parameters

projectItem IProjectItem

The IProjectItem which should be added.

Exceptions

ArgumentNullException

Thrown when projectItem is null.

NotSupportedException

Thrown when the collection is read only.

ArgumentException

Thrown when the collection already contains a IProjectItem instance with the name of projectItem.

Clear()

Removes all IProjectItems.

public void Clear()

Exceptions

NotSupportedException

Thrown when IsReadOnly is true.

Contains(IProjectItem)

Determines whether a sequence contains a specified element by using the default equality comparer.

public bool Contains(IProjectItem projectItem)

Parameters

projectItem IProjectItem

The IProjectItem which should be searched.

Returns

bool

True, if the ProjectItemCollection contains this element.

CopyTo(IProjectItem[], int)

Copies the elements of the ProjectItemCollection to an Array.

public void CopyTo(IProjectItem[] array, int arrayIndex)

Parameters

array IProjectItem[]

The one-dimensional Array that is the destination of the elements copied.

arrayIndex int

The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException

Thrown when array is null.

GetEnumerator()

Returns an enumerator that iterates through the ProjectItemCollection.

public IEnumerator<IProjectItem> GetEnumerator()

Returns

IEnumerator<IProjectItem>

The collection as IEnumerator.

Remove(IProjectItem)

Removes the projectItem form the collection.

public bool Remove(IProjectItem projectItem)

Parameters

projectItem IProjectItem

The IProjectItem which should be removed from the collection.

Returns

bool

true if the element is successfully found and removed; otherwise, false.

Exceptions

ArgumentNullException

Thrown when projectItem is null.

NotSupportedException

Thrown when IsReadOnly is true.

Events

CollectionChanged

Occurs when the collection changes.

public event NotifyCollectionChangedEventHandler CollectionChanged

Event Type

NotifyCollectionChangedEventHandler