[]
        
(Showing Draft Content)

C1.C1Preview.Scripting.ScriptingOptions

ScriptingOptions Class

Represents the various options controlling scripts and expressions used in a C1PrintDocument, and specified by the ScriptingOptions property.

Inheritance
ScriptingOptions
Namespace: C1.C1Preview.Scripting
Assembly: C1.PrintDocument.8.dll
Syntax
[C1ClassSerialization(true)]
public class ScriptingOptions
Remarks

Scripts and expressions can be used in various contexts in a C1PrintDocument. While the scripting language and the set of available assemblies and namespaces for all those scripts and expressions are defined by the properties of the document's ScriptingOptions, the sets of built-in variable identifiers available to a script or expression depend on the context in which it is defined.

The following tables list the possible contexts, and the identifiers that can be used in scripts and expressions to access context-dependent document data:

  • Text expressions In expressions specified in square brackets in texts of RenderText, RenderParagraph or RenderArea objects, the following context-dependent identifiers can be used:
    Id (type)Meaning
    Document (C1PrintDocument)The current document.
    RenderObject (RenderObject)The current render object.
    RenderFragment (RenderFragment)The current render fragment.
    Page (C1Page)The current page.
    PageNo (int)The current 1-based page number.
    PageCount (int)The total page count.
    PageX (int)The current 1-based horizontal page number.
    PageXCount (int)The maximum horizontal page count.
    PageY (int)The current 1-based vertical (regular) page number.
    PageYCount (int)The total vertical page count.
    Aggregates (AggregateCollection)The list of aggregates defined on the current document.
    DataBinding (C1DataBinding)The active databinding (may differ from the value of the DataBinding property on the current render object, e.g. if it is not defined and parent's databinding is being used).
    Fields (FieldCollection)A shortcut to Fields on the active databinding.
    RowNumber (int)A shortcut to RowNumber on the active databinding.

    (Note: while square brackets are the default for marking expressions in C1PrintDocument texts, they can be redefined via the TagOpenParen and TagCloseParen properties.).

  • C1DataBinding expressions In expressions used in any of Expressions, Expressions, Filters, OutlineText, the following context-dependent identifiers are available:
    Id (type)Meaning
    Document (C1PrintDocument)The current document.
    DataBinding (C1DataBinding)The current databinding.
    Fields (FieldCollection)The Fields collection of the current databinding.
    Parent (C1DataBinding)The parent databinding. Normally this is the most nested databinding defined on a parent of the object containing the current databinding. For a TableVectorGroup, this may be the databinding defined on another row/column group if that group encloses the current group (i.e. contains all its rows/columns).
  • DataSetField expression In expressions used to specify calculated data set fields (Expression), the following context-dependent identifiers are available:
    Id (type)Meaning
    Document (C1PrintDocument)The current document.
    Fields (DataSetFieldCollection)The Fields collection of the current data set.
  • Document scope scripts In scripts assigned to DocumentStartingScript, DocumentEndedScript, PageConfigureScript or ErrorScript, the following context-dependent identifiers are available:
    Id (type)Meaning
    Document (C1PrintDocument)The current document.
    Tags (TagCollection)The Tags collection of the current document (this is a shortcut to Document.Tags).
  • Render object scope scripts In scripts assigned to ObjectResolvedScript, the following context-dependent identifiers are available:
    Id (type)Meaning
    Document (C1PrintDocument)The current document.
    RenderObject (RenderObject)The current render object.
    Tags (TagCollection)The Tags collection of the current document (this is a shortcut to Document.Tags).
  • Render fragment scope scripts In scripts assigned to FragmentResolvedScript, the following context-dependent identifiers are available:
    Id (type)Meaning
    Document (C1PrintDocument)The current document.
    RenderObject (RenderObject)The current render object.
    RenderFragment (RenderFragment)The fragment that has resolved.
    Tags (TagCollection)The Tags collection of the current document (this is a shortcut to Document.Tags).

Properties

Name Description
ExternalAssemblies

Gets the list of external assemblies that can be used in scripts in the current document.

GenerateInMemory

Gets or sets a value indicating whether to generate script assemlies in memory. When this property is false all assemblies will be generated in directory specified by TempPath property. Note! C1PrintDocument does not delete created scripting assembles, the user's code is responsible for it.

Language

Gets or sets a value indicating which language is used in scripts attached to the document.

Namespaces

Gets the list of namespaces that can be used in scripts in the current document.

TempPath

Gets or sets the directory which will be used to hold temporary files generated during scripts compiling.

Methods

Name Description
AssignFrom(ScriptingOptions)

Assigns (copies) properties from another ScriptingOptions to the current object.

Initialize(string[], string[])

Initializes the current ScriptingOptions object witih the specified external assemblies and namespaces.

Reset()

Resets all properties of the current ScriptingOptions object to their default values.

ResetExternalAssemblies()

Resets the ExternalAssemblies property to its default value.

ResetNamespaces()

Resets the Namespaces property to its default value.

ShouldSerialize()

Indicates whether the current object should be serialized.

ShouldSerializeExternalAssemblies()

Indicates whether the ExternalAssemblies property should be serialized.

ShouldSerializeNamespaces()

Indicates whether the Namespaces property should be serialized.