ValueCollection Constructor
This constructor initializes a new instance of the VariableCollection class.
Syntax
public VariableCollection ( ) public VariableCollection ( string hvcPath )
Parameter | Description |
string hvcPath | The file name and path of a HotDocs variable collection (.HVC) file that HotDocs Server will use to populate the VariableCollection. If this parameter is missing, HotDocs Server will create an empty variable collection. |
Example
The following C# sample code displays information about the VariableCollection:
public class ExampleCode { static void Main() { HotDocs.Server.VariableCollection hvc = new HotDocs.Server.VariableCollection("C:\\Templates\\MyFile.hvc"); System.Console.WriteLine("VARIABLECOLLECTION OBJECT: --------------------------------------"); System.Console.WriteLine(" {0}: {1}","Count", hvc.Count); System.Console.WriteLine(" {0}: {1}","Description", hvc.Description); System.Console.WriteLine(" {0}: {1}","Title", hvc.Title); for (int i=0;i<hvc.Count;i++) System.Console.WriteLine(" {0}: {1} ({2})",hvc.VarType(i).ToString(), hvc.VarName(i),hvc.VarEncodedName(i)); hvc.Dispose(); } }