Table of Contents

Class IntegrationVariables

Namespace
Dynamicweb.DataIntegration.Integration
Assembly
Dynamicweb.DataIntegration.dll

An ordered collection of IntegrationVariable instances for a single scope level (global, group, or activity). Supports XML serialization both as an embedded node within a job file and as a stand-alone _variables.txt file.

public sealed class IntegrationVariables
Inheritance
IntegrationVariables
Inherited Members

Constructors

IntegrationVariables(IEnumerable<IntegrationVariable>)

Initializes a new IntegrationVariables from an existing sequence of variables.

public IntegrationVariables(IEnumerable<IntegrationVariable> variables)

Parameters

variables IEnumerable<IntegrationVariable>

The variables to include in the collection.

IntegrationVariables(XmlNode)

Initializes a new IntegrationVariables by deserializing from an XML node. Child elements named variable with name and value attributes are read; all other child nodes are ignored.

public IntegrationVariables(XmlNode node)

Parameters

node XmlNode

The XML node whose children contain the variable definitions.

Exceptions

ArgumentNullException

Thrown when node is null.

Fields

Empty

A shared empty instance representing a scope with no variables defined.

public static readonly IntegrationVariables Empty

Field Value

IntegrationVariables

FileName

The file name used for file-based variable storage (_variables.txt).

public const string FileName = "_variables.txt"

Field Value

string

XmlTagName

The XML element name used when serializing this collection (variables).

public static readonly string XmlTagName

Field Value

string

Properties

Variables

Gets a read-only ordered list of the variables in this collection.

public IReadOnlyList<IntegrationVariable> Variables { get; }

Property Value

IReadOnlyList<IntegrationVariable>

Methods

LoadFromFile(string)

Loads an IntegrationVariables collection from a _variables.txt file. Returns Empty when the file does not exist or contains invalid XML.

public static IntegrationVariables LoadFromFile(string filePath)

Parameters

filePath string

The full path to the variables file.

Returns

IntegrationVariables

The deserialized collection, or Empty if the file is absent or malformed.

SaveAsXML(XmlTextWriter)

Writes this collection as a <variables> XML element to the provided writer. Used when embedding variables inside a job XML file.

public void SaveAsXML(XmlTextWriter writer)

Parameters

writer XmlTextWriter

The writer to serialize into.

Exceptions

ArgumentNullException

Thrown when writer is null.

SaveToFile(string)

Saves this collection to a _variables.txt file in XML format (Unicode encoding). Creates or overwrites the file at filePath.

public void SaveToFile(string filePath)

Parameters

filePath string

The full path of the file to write.

ToDictionary()

Returns a dictionary keyed by upper-invariant variable name for use by the variable resolver. When duplicate names exist the first occurrence is retained.

public IReadOnlyDictionary<string, string> ToDictionary()

Returns

IReadOnlyDictionary<string, string>

A read-only dictionary mapping upper-case names to their values.

To top