Skip to main content

Class PublisherRestrictionCollection

Represents a collection a Publisher Restrictions index by Purpose ID.

Declaration
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.

Declaration
public int Count { get; }

Fields

publisherRestrictions

Declaration
protected Dictionary<int, PublisherRestriction> publisherRestrictions

Methods

Add(int, PublisherRestriction)

Adds a Publisher Restriction for a given Purpose ID to this collection.

Declaration
public void Add(int purposeId, PublisherRestriction publisherRestriction)
Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the Purpose.
Bidtellect.Tcf.Models.Components.ConsentString.PublisherRestrictionpublisherRestrictionThe Publisher Restriction.
Exceptions

System.ArgumentNullException

Remove(int)

Removes a Publisher Restriction for a given Purpose ID from this collection.

Declaration
public bool Remove(int purposeId)
Returns

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

Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the Purpose.

Contains(int)

Determines whether the collection contains a Publisher Restriction for a given Purpose ID.

Declaration
public bool Contains(int purposeId)
Returns

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

Parameters
TypeNameDescription
System.Int32purposeIdThe ID of the purpose.

TryGet(int, out PublisherRestriction)

Gets the Publisher Restriction for the given Purpose ID.

Declaration
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
TypeNameDescription
System.Int32purposeIdThe ID of the purpose.
Bidtellect.Tcf.Models.Components.ConsentString.PublisherRestrictionpublisherRestrictionWhen 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.

Declaration
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