Class PurposeCollection
Represents a collection of Purposes.
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.
public IEnumerable<int> Ids { get; }
Count
Gets the number of elements contained in this collection.
public int Count { get; }
Fields
purposes
protected Dictionary<int, Purpose> purposes
Methods
Add(Purpose)
Adds a Purpose to this collection.
public void Add(Purpose purpose)
Parameters
Type | Name | Description |
---|---|---|
Bidtellect.Tcf.Models.Components.VendorList.Purpose | purpose | The Purpose to be added. |
Exceptions
System.ArgumentException
System.ArgumentOutOfRangeException
Add(int)
Adds a Purpose to this collection.
public void Add(int purposeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the purporse. |
Exceptions
System.ArgumentException
System.ArgumentOutOfRangeException
Add(int, Purpose)
Adds a Purpose to this collection.
public void Add(int purposeId, Purpose purpose)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the purporse. |
Bidtellect.Tcf.Models.Components.VendorList.Purpose | purpose | The Purpose to be added. |
Exceptions
System.ArgumentException
System.ArgumentOutOfRangeException
Remove(int)
Removes a Purpose with the given ID from this collection.
public bool Remove(int purposeId)
Returns
System.Boolean
: A value indicating whether the Purpose was successfully found and removed.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the Purpose. |
Remove(Purpose)
Removes a purpose from this collection.
public bool Remove(Purpose purpose)
Returns
System.Boolean
: A value indicating whether the Purpose was succesfully found and removed.
Parameters
Type | Name | Description |
---|---|---|
Bidtellect.Tcf.Models.Components.VendorList.Purpose | purpose | The Purpose to be removed. |
Exceptions
System.ArgumentNullException
Contains(int)
Determines whether the collection contains a Purpose with the given ID.
public bool Contains(int purposeId)
Returns
System.Boolean
: true
if this collection contains a Purpose with the given ID;
otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the Purpose. |
TryGet(int, out Purpose)
Gets a Purpose with the given ID.
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
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the Purpose. |
Bidtellect.Tcf.Models.Components.VendorList.Purpose | purpose | When 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.
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