Class PublisherRestrictionCollection
Represents a collection a Publisher Restrictions index by Purpose ID.
public class PublisherRestrictionCollection : IEnumerable<KeyValuePair<int, PublisherRestriction>>, IEnumerable
Implements:
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.ConsentString.PublisherRestriction>>
, System.Collections.IEnumerable
Properties
Count
Gets the number of elements contained in this collection.
public int Count { get; }
Fields
publisherRestrictions
protected Dictionary<int, PublisherRestriction> publisherRestrictions
Methods
Add(int, PublisherRestriction)
Adds a Publisher Restriction for a given Purpose ID to this collection.
public void Add(int purposeId, PublisherRestriction publisherRestriction)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the Purpose. |
Bidtellect.Tcf.Models.Components.ConsentString.PublisherRestriction | publisherRestriction | The Publisher Restriction. |
Exceptions
System.ArgumentNullException
Remove(int)
Removes a Publisher Restriction for a given Purpose ID from this collection.
public bool Remove(int purposeId)
Returns
System.Boolean
: A value indicating whether the Publisher Restriction was successfully found and removed.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the Purpose. |
Contains(int)
Determines whether the collection contains a Publisher Restriction for a given Purpose ID.
public bool Contains(int purposeId)
Returns
System.Boolean
: true
if this collection contains a Publisher Restriction for the given Purpose ID; otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the purpose. |
TryGet(int, out PublisherRestriction)
Gets the Publisher Restriction for the given Purpose ID.
public bool TryGet(int purposeId, out PublisherRestriction publisherRestriction)
Returns
System.Boolean
: true
if this collection contains a Publisher Restriction for the given Purpose ID; otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | purposeId | The ID of the purpose. |
Bidtellect.Tcf.Models.Components.ConsentString.PublisherRestriction | publisherRestriction | When this method returns, contains the Publisher Restriction for the Purpose ID, |
if the Purpose is found; otherwise, null . | ||
This parameter is passed uninitialized. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<int, PublisherRestriction>> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.ConsentString.PublisherRestriction>>
: 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.ConsentString.PublisherRestriction>>
System.Collections.IEnumerable