Table of Contents

Class SharedAccessBlobPolicies

Namespace
Microsoft.WindowsAzure.Storage.Blob
Assembly
Microsoft.WindowsAzure.Storage.dll

Represents the collection of shared access policies defined for a container.

public sealed class SharedAccessBlobPolicies : IDictionary<string, SharedAccessBlobPolicy>, ICollection<KeyValuePair<string, SharedAccessBlobPolicy>>, IEnumerable<KeyValuePair<string, SharedAccessBlobPolicy>>, IEnumerable
Inheritance
SharedAccessBlobPolicies
Implements
Inherited Members

Constructors

SharedAccessBlobPolicies()

public SharedAccessBlobPolicies()

Properties

Count

Gets the number of key/SharedAccessBlobPolicy value pairs contained in the shared access policies collection.

public int Count { get; }

Property Value

int

The number of key/SharedAccessBlobPolicy value pairs contained in the shared access policies collection.

IsReadOnly

Gets a value indicating whether the collection of shared access policies is read-only.

public bool IsReadOnly { get; }

Property Value

bool

true if the collection of shared access policies is read-only; otherwise, false.

this[string]

Gets or sets the SharedAccessBlobPolicy item associated with the specified key.

public SharedAccessBlobPolicy this[string key] { get; set; }

Parameters

key string

A string containing the key of the SharedAccessBlobPolicy value to get or set.

Property Value

SharedAccessBlobPolicy

The SharedAccessBlobPolicy item associated with the specified key, or null if key is not in the shared access policies collection.

Keys

Gets a collection containing the keys in the shared access policies collection.

public ICollection<string> Keys { get; }

Property Value

ICollection<string>

A collection of strings containing the keys of the shared access policies collection.

Values

Gets a collection containing the values in the shared access policies collection.

public ICollection<SharedAccessBlobPolicy> Values { get; }

Property Value

ICollection<SharedAccessBlobPolicy>

A collection of SharedAccessBlobPolicy items in the shared access policies collection.

Methods

Add(KeyValuePair<string, SharedAccessBlobPolicy>)

Adds the specified key/SharedAccessBlobPolicy value, stored in a KeyValuePair<TKey, TValue>, to the collection of shared access policies.

public void Add(KeyValuePair<string, SharedAccessBlobPolicy> item)

Parameters

item KeyValuePair<string, SharedAccessBlobPolicy>

The KeyValuePair<TKey, TValue> object, containing a key/SharedAccessBlobPolicy value pair, to add to the shared access policies collection.

Add(string, SharedAccessBlobPolicy)

Adds the specified key and SharedAccessBlobPolicy value to the collection of shared access policies.

public void Add(string key, SharedAccessBlobPolicy value)

Parameters

key string

The key of the SharedAccessBlobPolicy value to add.

value SharedAccessBlobPolicy

The SharedAccessBlobPolicy value to add the collection of shared access policies.

Clear()

Removes all keys and SharedAccessBlobPolicy values from the shared access collection.

public void Clear()

Contains(KeyValuePair<string, SharedAccessBlobPolicy>)

Determines whether the collection of shared access policies contains the key and SharedAccessBlobPolicy value in the specified KeyValuePair<TKey, TValue> object.

public bool Contains(KeyValuePair<string, SharedAccessBlobPolicy> item)

Parameters

item KeyValuePair<string, SharedAccessBlobPolicy>

A KeyValuePair<TKey, TValue> object containing the key and SharedAccessBlobPolicy value to search for.

Returns

bool

true if the shared access policies collection contains the specified key/value; otherwise, false.

ContainsKey(string)

Determines whether the collection of shared access policies contains the specified key.

public bool ContainsKey(string key)

Parameters

key string

The key to locate in the collection of shared access policies.

Returns

bool

true if the collection of shared access policies contains an element with the specified key; otherwise, false.

CopyTo(KeyValuePair<string, SharedAccessBlobPolicy>[], int)

Copies each key in the key/SharedAccessBlobPolicy value pair to a compatible one-dimensional array, starting at the specified index of the target array.

public void CopyTo(KeyValuePair<string, SharedAccessBlobPolicy>[] array, int arrayIndex)

Parameters

array KeyValuePair<string, SharedAccessBlobPolicy>[]

A one-dimensional array of SharedAccessBlobPolicy objects that serves as the destination for the elements copied from the shared access policies collection.

arrayIndex int

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

GetEnumerator()

Returns an enumerator that iterates through the collection of shared access policies.

public IEnumerator<KeyValuePair<string, SharedAccessBlobPolicy>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, SharedAccessBlobPolicy>>

An IEnumerator<T> of type KeyValuePair<TKey, TValue>.

Remove(KeyValuePair<string, SharedAccessBlobPolicy>)

Removes the SharedAccessBlobPolicy value, specified in the KeyValuePair<TKey, TValue> object, from the shared access policies collection.

public bool Remove(KeyValuePair<string, SharedAccessBlobPolicy> item)

Parameters

item KeyValuePair<string, SharedAccessBlobPolicy>

The KeyValuePair<TKey, TValue> object, containing a key and SharedAccessBlobPolicy value, to remove from the shared access policies collection.

Returns

bool

true if the item was successfully removed; otherwise, false.

Remove(string)

Removes the value with the specified key from the shared access policies collection.

public bool Remove(string key)

Parameters

key string

A string containing the key of the SharedAccessBlobPolicy item to remove.

Returns

bool

true if the element is successfully found and removed; otherwise, false. This method returns false if the key is not found.

TryGetValue(string, out SharedAccessBlobPolicy)

Gets the SharedAccessBlobPolicy item associated with the specified key.

public bool TryGetValue(string key, out SharedAccessBlobPolicy value)

Parameters

key string

A string containing the key of the value to get.

value SharedAccessBlobPolicy

The SharedAccessBlobPolicy item to get.

Returns

bool

The SharedAccessBlobPolicy item associated with the specified key, if the key is found; otherwise, the default value for the SharedAccessBlobPolicy type.