Class ExcelProtectedRangeCollection
A collection of protected ranges in the worksheet. ExcelProtection ExcelSheetProtection ExcelEncryption
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelProtectedRangeCollection : XmlHelper, IEnumerable<ExcelProtectedRange>, IEnumerable
Properties
Count
Numner of items in the collection
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Item[Int32]
Indexer for the collection
Declaration
public ExcelProtectedRange this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The index to return |
Property Value
| Type | Description |
|---|---|
| ExcelProtectedRange |
Methods
Add(String, ExcelAddress)
Adds a new protected range
Declaration
public ExcelProtectedRange Add(string name, ExcelAddress address)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name of the protected range |
| ExcelAddress | address | The address within the worksheet |
Returns
| Type | Description |
|---|---|
| ExcelProtectedRange |
Clear()
Clears all protected ranges
Declaration
public void Clear()
Contains(ExcelProtectedRange)
Checks if the collection contains a specific item.
Declaration
public bool Contains(ExcelProtectedRange item)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange | item |
Returns
| Type | Description |
|---|---|
| Boolean |
CopyTo(ExcelProtectedRange[], Int32)
Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.
Declaration
public void CopyTo(ExcelProtectedRange[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange[] | array | The array |
| Int32 | arrayIndex | The index |
IndexOf(ExcelProtectedRange)
Get the index in the collection of the supplied item
Declaration
public int IndexOf(ExcelProtectedRange item)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange | item | The item |
Returns
| Type | Description |
|---|---|
| Int32 |
Remove(ExcelProtectedRange)
Remove the specified item from the collection
Declaration
public bool Remove(ExcelProtectedRange item)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange | item | The item |
Returns
| Type | Description |
|---|---|
| Boolean |
RemoveAt(Int32)
Remove the item at the specified indexx
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index |
Explicit Interface Implementations
IEnumerable<ExcelProtectedRange>.GetEnumerator()
Get the enumerator
Declaration
IEnumerator<ExcelProtectedRange> IEnumerable<ExcelProtectedRange>.GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<ExcelProtectedRange> | The enumerator |
IEnumerable.GetEnumerator()
Get the enumerator
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator | The enumerator |
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable