Class SharedAccessTablePolicies
- Namespace
- Microsoft.WindowsAzure.Storage.Table
- Assembly
- Microsoft.WindowsAzure.Storage.dll
Represents the collection of shared access policies defined for a table.
public sealed class SharedAccessTablePolicies : IDictionary<string, SharedAccessTablePolicy>, ICollection<KeyValuePair<string, SharedAccessTablePolicy>>, IEnumerable<KeyValuePair<string, SharedAccessTablePolicy>>, IEnumerable
- Inheritance
-
SharedAccessTablePolicies
- Implements
- Inherited Members
Constructors
SharedAccessTablePolicies()
public SharedAccessTablePolicies()
Properties
Count
Gets the number of key/SharedAccessTablePolicy value pairs contained in the shared access policies collection.
public int Count { get; }
Property Value
- int
The number of key/SharedAccessTablePolicy 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 SharedAccessTablePolicy item associated with the specified key.
public SharedAccessTablePolicy this[string key] { get; set; }
Parameters
key
stringThe key of the value to get or set.
Property Value
- SharedAccessTablePolicy
The SharedAccessTablePolicy 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 containing the keys in the of shared access policies collection.
Values
Gets a collection containing the values in the shared access policies collection.
public ICollection<SharedAccessTablePolicy> Values { get; }
Property Value
- ICollection<SharedAccessTablePolicy>
A collection of SharedAccessTablePolicy items in the shared access policies collection.
Methods
Add(KeyValuePair<string, SharedAccessTablePolicy>)
Adds the specified key/SharedAccessTablePolicy value, stored in a KeyValuePair<TKey, TValue>, to the collection of shared access policies.
public void Add(KeyValuePair<string, SharedAccessTablePolicy> item)
Parameters
item
KeyValuePair<string, SharedAccessTablePolicy>The KeyValuePair<TKey, TValue> object, containing a key/SharedAccessTablePolicy value pair, to add to the shared access policies collection.
Add(string, SharedAccessTablePolicy)
Adds the specified key and SharedAccessTablePolicy value to the collection of shared access policies.
public void Add(string key, SharedAccessTablePolicy value)
Parameters
key
stringThe key of the SharedAccessTablePolicy value to add.
value
SharedAccessTablePolicyThe SharedAccessTablePolicy value to add to the collection of shared access policies.
Clear()
Removes all keys and SharedAccessTablePolicy values from the shared access collection.
public void Clear()
Contains(KeyValuePair<string, SharedAccessTablePolicy>)
Determines whether the collection of shared access policies contains the key and SharedAccessTablePolicy value in the specified KeyValuePair<TKey, TValue> object.
public bool Contains(KeyValuePair<string, SharedAccessTablePolicy> item)
Parameters
item
KeyValuePair<string, SharedAccessTablePolicy>A KeyValuePair<TKey, TValue> object containing the key and SharedAccessTablePolicy 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
stringThe 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, SharedAccessTablePolicy>[], int)
Copies each key/SharedAccessTablePolicy value pair in the shared access policies collection to a compatible one-dimensional array, starting at the specified index of the target array.
public void CopyTo(KeyValuePair<string, SharedAccessTablePolicy>[] array, int arrayIndex)
Parameters
array
KeyValuePair<string, SharedAccessTablePolicy>[]A one-dimensional array of SharedAccessTablePolicy objects that serves as the destination for the elements copied from the shared access policies collection.
arrayIndex
intThe 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, SharedAccessTablePolicy>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<string, SharedAccessTablePolicy>>
An IEnumerator<T> of type KeyValuePair<TKey, TValue>.
Remove(KeyValuePair<string, SharedAccessTablePolicy>)
Removes the SharedAccessTablePolicy value, specified in the KeyValuePair<TKey, TValue> object, from the shared access policies collection.
public bool Remove(KeyValuePair<string, SharedAccessTablePolicy> item)
Parameters
item
KeyValuePair<string, SharedAccessTablePolicy>The KeyValuePair<TKey, TValue> object, containing a key and SharedAccessTablePolicy 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
stringThe key of the SharedAccessTablePolicy item to remove.
Returns
- bool
true
if the element is successfully found and removed; otherwise,false
. This method returnsfalse
if the key is not found.
TryGetValue(string, out SharedAccessTablePolicy)
Gets the SharedAccessTablePolicy item associated with the specified key.
public bool TryGetValue(string key, out SharedAccessTablePolicy value)
Parameters
key
stringThe key of the value to get.
value
SharedAccessTablePolicyThe SharedAccessTablePolicy item to get.
Returns
- bool
The SharedAccessTablePolicy item associated with the specified key, if the key is found; otherwise, the default value for the SharedAccessTablePolicy type.