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