ExcelCustomDocumentPropertyCollection
OfficeIMO.Excel
Tracks workbook custom document properties and marks the owning document dirty when callers mutate the collection directly. Property values remain associated with the collection across saves until removed or replaced by the caller.
Inheritance
- object
- ExcelCustomDocumentPropertyCollection
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property ExcelDocument.CustomProperties
Methods
public ExcelCustomProperty Add(string key, ExcelCustomProperty value) #Adds a property and returns the value attached to this workbook.
Parameters
- key string
- value OfficeIMO.Excel.ExcelCustomProperty
Returns
ExcelCustomPropertypublic ExcelCustomProperty Add(KeyValuePair<string, ExcelCustomProperty> item) #Adds a property pair and returns the value attached to this workbook.
Parameters
- item System.Collections.Generic.KeyValuePair<string, OfficeIMO.Excel.ExcelCustomProperty>
Returns
ExcelCustomPropertypublic void Clear() #Removes all items from the ICollection<T>.
Exceptions
NotSupportedException– The ICollection<T> is read-only.
public bool Contains(KeyValuePair<string, ExcelCustomProperty> item) #Determines whether the ICollection<T> contains a specific value.
Parameters
- item System.Collections.Generic.KeyValuePair<string, OfficeIMO.Excel.ExcelCustomProperty>
- The object to locate in the ICollection<T>.
Returns
bool true if item is found in the ICollection<T>; otherwise, false.public bool ContainsKey(string key) #Determines whether the IDictionary<T1, T2> contains an element with the specified key.
Parameters
- key string
- The key to locate in the IDictionary<T1, T2>.
Returns
bool true if the IDictionary<T1, T2> contains an element with the key; otherwise, false.Exceptions
ArgumentNullException– key is null.
public void CopyTo(KeyValuePair<string, ExcelCustomProperty>[] array, int arrayIndex) #Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Parameters
- array System.Collections.Generic.KeyValuePair<string, OfficeIMO.Excel.ExcelCustomProperty>[]
- The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
- arrayIndex int
- The zero-based index in array at which copying begins.
Exceptions
ArgumentNullException– array is null.ArgumentOutOfRangeException– arrayIndex is less than 0.ArgumentException– The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.
public IEnumerator<KeyValuePair<string, ExcelCustomProperty>> GetEnumerator() #Returns an enumerator that iterates through the collection.
Returns
IEnumerator<KeyValuePair<string, ExcelCustomProperty>> An enumerator that can be used to iterate through the collection.public bool Remove(string key) #Removes the element with the specified key from the IDictionary<T1, T2>.
Parameters
- key string
- The key of the element to remove.
Returns
bool true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<T1, T2>.Exceptions
ArgumentNullException– key is null.NotSupportedException– The IDictionary<T1, T2> is read-only.
public bool Remove(KeyValuePair<string, ExcelCustomProperty> item) #Removes the first occurrence of a specific object from the ICollection<T>.
Parameters
- item System.Collections.Generic.KeyValuePair<string, OfficeIMO.Excel.ExcelCustomProperty>
- The object to remove from the ICollection<T>.
Returns
bool true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.Exceptions
NotSupportedException– The ICollection<T> is read-only.
public bool TryGetValue(string key, out ExcelCustomProperty value) #Gets the value associated with the specified key.
Parameters
- key string
- The key whose value to get.
- value OfficeIMO.Excel.ExcelCustomProperty
- When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
Returns
bool true if the object that implements IDictionary<T1, T2> contains an element with the specified key; otherwise, false.Exceptions
ArgumentNullException– key is null.
Inherited Methods
Properties
public ExcelCustomProperty this[string key] { get; set; } #Gets or sets the element with the specified key.
Parameters
- key string
- The key of the element to get or set.
Exceptions
ArgumentNullException– key is null.KeyNotFoundException– The property is retrieved and key is not found.NotSupportedException– The property is set and the IDictionary<T1, T2> is read-only.
public ICollection<string> Keys { get; } #Gets an ICollection<T> containing the keys of the IDictionary<T1, T2>.
public ICollection<ExcelCustomProperty> Values { get; } #Gets an ICollection<T> containing the values in the IDictionary<T1, T2>.
public int Count { get; } #Gets the number of elements contained in the ICollection<T>.
public bool IsReadOnly { get; } #Gets a value indicating whether the ICollection<T> is read-only.