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
variablesIEnumerable<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
nodeXmlNodeThe XML node whose children contain the variable definitions.
Exceptions
- ArgumentNullException
Thrown when
nodeisnull.
Fields
Empty
A shared empty instance representing a scope with no variables defined.
public static readonly IntegrationVariables Empty
Field Value
FileName
The file name used for file-based variable storage (_variables.txt).
public const string FileName = "_variables.txt"
Field Value
XmlTagName
The XML element name used when serializing this collection (variables).
public static readonly string XmlTagName
Field Value
Properties
Variables
Gets a read-only ordered list of the variables in this collection.
public IReadOnlyList<IntegrationVariable> Variables { get; }
Property Value
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
filePathstringThe 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
writerXmlTextWriterThe writer to serialize into.
Exceptions
- ArgumentNullException
Thrown when
writerisnull.
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
filePathstringThe 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.