Class WorkbookNamesCollection
Collection of the Workbook names (NamedRanges).
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.Collections
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public class WorkbookNamesCollection : CollectionBaseEx<IName>, IList<IName>, ICollection<IName>, IEnumerable<IName>, IParentApplication, ICloneParent, INames, IEnumerable
Constructors
WorkbookNamesCollection(IApplication, Object)
Creates an empty collection.
Declaration
public WorkbookNamesCollection(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the collection. |
System.Object | parent | Parent object for the collection. |
Properties
Count
Represents the known and unknown named ranges Count
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
IsWorkbookNamesChanged
set Flags m_bWorkNamesChanged
Declaration
public bool IsWorkbookNamesChanged { get; set; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Returns a single Name object from a Names collection.
Declaration
public IName this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
IName |
Item[String]
Returns a single Name object from a Names collection.
Declaration
public IName this[string name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Property Value
Type |
---|
IName |
ParentWorksheet
Returns parent worksheet of the collection.
Declaration
public IWorksheet ParentWorksheet { get; }
Property Value
Type |
---|
IWorksheet |
Methods
Add(IName)
Defines a new name. Returns a Name object.
Declaration
public IName Add(IName name)
Parameters
Type | Name | Description |
---|---|---|
IName | name | IName object that must be added to the collection. |
Returns
Type | Description |
---|---|
IName | Created IName object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the collection already contains object with the same name. |
Add(NameRecord)
Defines a new name. Returns a Name object.
Declaration
public IName Add(NameRecord name)
Parameters
Type | Name | Description |
---|---|---|
NameRecord | name | NameRecord describing new Name object. |
Returns
Type | Description |
---|---|
IName | Newly created Name object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the collection already contains object with the same name. |
System.ArgumentNullException | When specified NameRecord is NULL. |
Add(String)
Declaration
public IName Add(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type |
---|
IName |
Add(String, IRange)
Defines a new name. Returns a Name object.
Declaration
public IName Add(string name, IRange namedRange)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the new collection entry. |
IRange | namedRange | Range that will be associated with the name. |
Returns
Type | Description |
---|---|
IName | Created IName object. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the collection already contains object with the same name or if specified name string is empty. |
System.ArgumentNullException | When one of the arguments is NULL. |
AddCopy(IName, IWorksheet, Dictionary<Int32, Int32>, IDictionary)
Adds copy of global name during worksheet copy.
Declaration
public IName AddCopy(IName nameToCopy, IWorksheet destSheet, Dictionary<int, int> hashExternSheetIndexes, IDictionary hashNewWorksheetNames)
Parameters
Type | Name | Description |
---|---|---|
IName | nameToCopy | Name to copy. |
IWorksheet | destSheet | Destination worksheet. |
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | hashExternSheetIndexes | Dictionary with new extern worksheet names. |
System.Collections.IDictionary | hashNewWorksheetNames | Dictionary with new worksheet names. |
Returns
Type | Description |
---|---|
IName | Added name. |
AddFunctions(String)
Adds local user-defined function.
Declaration
public int AddFunctions(string strFunctionName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strFunctionName | Function to add. |
Returns
Type | Description |
---|---|
System.Int32 | Name index of the added function. |
AddLocal(IName)
Adds into list and hashtable, for local named ranges.
Declaration
public void AddLocal(IName name)
Parameters
Type | Name | Description |
---|---|---|
IName | name | Name to add. |
AddLocal(IName, Boolean)
Adds into list and hashtable, for local named ranges.
Declaration
public void AddLocal(IName name, bool bAddInGlobalNamesHash)
Parameters
Type | Name | Description |
---|---|---|
IName | name | Name to add. |
System.Boolean | bAddInGlobalNamesHash | Indicates is adds in global names hash. |
AddRange(NameRecord[])
Defines multiple names.
Declaration
public void AddRange(NameRecord[] names)
Parameters
Type | Name | Description |
---|---|---|
NameRecord[] | names | Array of Name Records that describes new Name objects. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the collection already contains object with the same name. |
System.ArgumentNullException | When array of NameRecords is NULL. |
Clone(Object)
Creates a copy of the current collection.
Declaration
public override object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new collection. |
Returns
Type | Description |
---|---|
System.Object | A copy of the current collection. |
Overrides
Contains(String)
Declaration
public bool Contains(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type |
---|
System.Boolean |
ConvertFullRowColumnNames(ExcelVersion)
Converts full row or column tokens between versions.
Declaration
public void ConvertFullRowColumnNames(ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
ExcelVersion | version | Version to convert into. |
GetNameRecordByIndex(Int32)
Gets name record by index.
Declaration
public NameRecord GetNameRecordByIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of name object in collection. |
Returns
Type | Description |
---|---|
NameRecord | Returns named record. |
InsertColumn(Int32, Int32, String)
Updates named ranges after column insertion.
Declaration
public void InsertColumn(int iColumnIndex, int iCount, string strSheetName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex | One-based column index. |
System.Int32 | iCount | Number of columns to insert. |
System.String | strSheetName | Represents reference sheet name. |
InsertRow(Int32, Int32, String)
Updates named range when inserting row.
Declaration
public void InsertRow(int iRowIndex, int iRowCount, string strSheetName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowIndex | Represents row index. |
System.Int32 | iRowCount | Represents row count. |
System.String | strSheetName | Represents sheet for update. |
MarkUsedReferences(Boolean[])
Sets items with used reference indexes to true.
Declaration
public void MarkUsedReferences(bool[] usedItems)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean[] | usedItems | Array to mark used references in. |
OnClearComplete()
OnClear is invoked after Clear behavior.
Declaration
protected override void OnClearComplete()
Overrides
OnInsertComplete(Int32, IName)
Performs additional processes after inserting a new element into the collection.
Declaration
protected override void OnInsertComplete(int index, IName value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which to insert value. |
IName | value | The new value of the element at the index. |
Overrides
ParseNames()
Forces all named ranges to parse its data.
Declaration
public void ParseNames()
Remove(Int32[])
Declaration
public void Remove(int[] arrIndexes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | arrIndexes |
Remove(String)
Removes specified name from the collection.
Declaration
public void Remove(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the object to remove. |
RemoveAt(Int32)
Removes the element at the specified index from the collection.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the element to remove. |
RemoveColumn(Int32, String)
Updates named ranges after column removal.
Declaration
public void RemoveColumn(int iColumnIndex, string strSheetName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex | One-based column index. |
System.String | strSheetName | Represents reference sheet name. |
RemoveColumn(Int32, String, Int32)
Updates named ranges after column removal.
Declaration
public void RemoveColumn(int iColumnIndex, string strSheetName, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex | One-based column index. |
System.String | strSheetName | Represents reference sheet name. |
System.Int32 | count | Number of columns to remove. |
RemoveRow(Int32, String)
Updates named range when deleting row.
Declaration
public void RemoveRow(int iRowIndex, string strSheetName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowIndex | Represents row index. |
System.String | strSheetName | Represents sheet for update. |
RemoveRow(Int32, String, Int32)
Updates named range when deleting row.
Declaration
public void RemoveRow(int iRowIndex, string strSheetName, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowIndex | Represents row index. |
System.String | strSheetName | Represents sheet for update. |
System.Int32 | count | Number of rows to remove. |
Serialize(OffsetArrayList)
Saves all NameRecords to the specified OffsetArrayList.
Declaration
public void Serialize(OffsetArrayList records)
Parameters
Type | Name | Description |
---|---|---|
OffsetArrayList | records | OffsetArrayList that will receive all NameRecords. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If specified OffsetArrayList is NULL. |
UpdateReferenceIndexes(Int32[])
Updates reference indexes.
Declaration
public void UpdateReferenceIndexes(int[] arrUpdatedIndexes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | arrUpdatedIndexes | Array with updated indexes. |
Explicit Interface Implementations
INames.Count
Represent the known named ranges count The name in the formula which has no reference is unknown named ranges
Declaration
int INames.Count { get; }
Returns
Type |
---|
System.Int32 |
INames.get_Item(Int32)
Declaration
IName INames.get_Item(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
IName |
INames.get_Item(String)
Declaration
IName INames.get_Item(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type |
---|
IName |
INames.Item[Int32]
Returns a single Name object from a Names collection by integer index in the API level
Declaration
IName INames.this[] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
IName |
INames.Item[String]
Returns a single Name object from a Names collection by name in the API level
Declaration
IName INames.this[] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type |
---|
IName |