Spread Windows Forms 7.0 Product Documentation
GetCustomNameEnumerator Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > ICustomNameSupport Interface : GetCustomNameEnumerator Method


Glossary Item Box

Gets an IEnumerator that enumerates through the custom names defined in the model.

Syntax

Visual Basic (Declaration) 
Function GetCustomNameEnumerator() As IEnumerator
Visual Basic (Usage)Copy Code
Dim instance As ICustomNameSupport
Dim value As IEnumerator
 
value = instance.GetCustomNameEnumerator()
C# 
IEnumerator GetCustomNameEnumerator()

Return Value

IEnumerator containing the enumerator for the custom name

Example

This example enumerates through the custom names.
C#Copy Code
System.Collections.IEnumerator se;
FarPoint.Win.Spread.Model.ICustomNameSupport cns;
cns = (FarPoint.Win.Spread.Model.ICustomNameSupport)fpSpread1.ActiveSheet.Models.Data;
cns.AddCustomName("ALPHA", "SUM(A1,A2)", 1, 1);
cns.AddCustomName("GAMMA", "A1*A2", 2, 2);
fpSpread1.ActiveSheet.SetFormula(1, 1, "ALPHA");
fpSpread1.ActiveSheet.SetFormula(2, 2, "GAMMA");
fpSpread1.ActiveSheet.SetValue(0, 0, 10);
fpSpread1.ActiveSheet.SetValue(1, 0, 10);
se = cns.GetCustomNameEnumerator();
listBox1.Items.AddRange(new Object[] {se.MoveNext().ToString(), se.Current.ToString(), se.MoveNext().ToString(), se.Current.ToString()});
Visual BasicCopy Code
Dim se As System.Collections.IEnumerator
Dim cns As FarPoint.Win.Spread.Model.ICustomNameSupport
cns = FpSpread1.ActiveSheet.Models.Data
cns.AddCustomName("ALPHA", "SUM(A1,A2)", 1, 1)
cns.AddCustomName("GAMMA", "A1*A2", 2, 2)
FpSpread1.ActiveSheet.SetFormula(1, 1, "ALPHA")
FpSpread1.ActiveSheet.SetFormula(2, 2, "GAMMA")
FpSpread1.ActiveSheet.SetValue(0, 0, 10)
FpSpread1.ActiveSheet.SetValue(1, 0, 10)
se = cns.GetCustomNameEnumerator()
ListBox1.Items.AddRange(New Object() {se.MoveNext().ToString(), se.Current().ToString(), se.MoveNext().ToString(), se.Current().ToString()})

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.