Assemblies and Namespaces
By default, the following assemblies are available (referenced) for scripts:
• System
• System.Drawing
To add another (system or custom) assembly to the list of assemblies referenced in scripts, add it to the C1PrintDocument.ScriptingOptions.ExternalAssemblies collection on the document. For instance, the following will add a reference to the System.Data assembly to the document's scripts:
Dim doc As New C1PrintDocument()
doc.ScriptingOptions.ExternalAssemblies.Add("System.Data.dll")
• C#
C1PrintDocument doc = new C1PrintDocument();
doc.ScriptingOptions.ExternalAssemblies.Add("System.Data.dll");
The following namespaces are by default available (imported) for use in scripts:
• System
• System.Collections
• System.Collections.Generic
• System.Text
• Microsoft.VisualBasic
• System.Drawing
To add another namespace, add it to the C1PrintDocument.ScriptingOptions.Namespaces collection on the document. For instance, this will allow the use of types declared in System.Data namespace in the document's scripts without fully qualifying them with the namespace:
Dim doc As New C1PrintDocument()
doc.ScriptingOptions. Namespaces.Add("System.Data")
• C#
C1PrintDocument doc = new C1PrintDocument();
doc.ScriptingOptions. Namespaces.Add("System.Data");
|