Value Constructor

This constructor initializes a new instance of the Value class. For example, if you want to add a new piece of data to an existing HotDocs Answer, you could create a Value object, add the new data to the object, and then add the Value to the Answer.

Syntax

public Value ( )

Example

The following Visual C# example creates a new AnswerCollection that contains a single Answer with three Values. The AnswerCollection is then saved to disk as a HotDocs Answer File.

public class ExampleCode
{
    static void Main()
    {
        // Create a new AnswerCollection.
        using (HotDocs.Server.AnswerCollection ac = new HotDocs.Server.AnswerCollection())
        {
            // Create an Answer to represent the child names and add it to the AnswerCollection.
            using (HotDocs.Server.Answer names = new HotDocs.Server.Answer())
            {
                names.Name = "Child Name";
                names.AnswerType = HotDocs.Server.Interop.ansType.ansTypeText;
                int cnt = 3;
                for (int i = 0; i < cnt; i++)
                {
                    // Create a new Value for each child's name and then add it to the Answer.
                    HotDocs.Server.Value nameVal = new HotDocs.Server.Value();
                    nameVal.RepeatIndex1 = i; // set the iteration of the value
                    nameVal.value = System.String.Format("Dave {0}", i); // all the children are named Dave, just like in the Dr. Seuss story
                    names.Add(nameVal);
                }
                ac.Add(names);
            }
            ac.Save(@"c:\temp\children.anx");
        }
    }
}