Skip to main content

Class PurposeCollection

Represents a collection of Purposes.

Declaration
public class PurposeCollection : IEnumerable<KeyValuePair<int, Purpose>>, IEnumerable

Implements:
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.VendorList.Purpose>>, System.Collections.IEnumerable

Properties

Ids

Gets an enumerable collection of the Purpose IDs contained in this collection.

Declaration
public IEnumerable<int> Ids { get; }

Count

Gets the number of elements contained in this collection.

Declaration
public int Count { get; }

Fields

purposes

Declaration
protected Dictionary<int, Purpose> purposes

Methods

Add(Purpose)

Adds a Purpose to this collection.

Declaration
public void Add(Purpose purpose)
Parameters
TypeNameDescription
Bidtellect.Tcf.Models.Components.VendorList.PurposepurposeThe Purpose to be added.
Exceptions

System.ArgumentException
System.ArgumentOutOfRangeException

Add(int)

Adds a Purpose to this collection.

Declaration
public void Add(int purposeId)
Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the purporse.
Exceptions

System.ArgumentException
System.ArgumentOutOfRangeException

Add(int, Purpose)

Adds a Purpose to this collection.

Declaration
public void Add(int purposeId, Purpose purpose)
Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the purporse.
Bidtellect.Tcf.Models.Components.VendorList.PurposepurposeThe Purpose to be added.
Exceptions

System.ArgumentException
System.ArgumentOutOfRangeException

Remove(int)

Removes a Purpose with the given ID from this collection.

Declaration
public bool Remove(int purposeId)
Returns

System.Boolean: A value indicating whether the Purpose was successfully found and removed.

Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the Purpose.

Remove(Purpose)

Removes a purpose from this collection.

Declaration
public bool Remove(Purpose purpose)
Returns

System.Boolean: A value indicating whether the Purpose was succesfully found and removed.

Parameters
TypeNameDescription
Bidtellect.Tcf.Models.Components.VendorList.PurposepurposeThe Purpose to be removed.
Exceptions

System.ArgumentNullException

Contains(int)

Determines whether the collection contains a Purpose with the given ID.

Declaration
public bool Contains(int purposeId)
Returns

System.Boolean: true if this collection contains a Purpose with the given ID; otherwise, false.

Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the Purpose.

TryGet(int, out Purpose)

Gets a Purpose with the given ID.

Declaration
public bool TryGet(int purposeId, out Purpose purpose)
Returns

System.Boolean: true if this collection contains a Purpose with the given ID; otherwise, false.

Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the Purpose.
Bidtellect.Tcf.Models.Components.VendorList.PurposepurposeWhen this method returns, contains the Purpose,
if the ID is found; otherwise, null.
This parameter is passed uninitialized.

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<KeyValuePair<int, Purpose>> GetEnumerator()
Returns

System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.VendorList.Purpose>>: An enumerator that can be used to iterate through the collection.

Implements

  • System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.VendorList.Purpose>>
  • System.Collections.IEnumerable