IGlobalVariables

Assembly: ZennoLab.InterfacesLibrary
Full name: ZennoLab.InterfacesLibrary.ProjectModel.Collections.IGlobalVariables
Kind: interface


Represents a collection of global variables that can be accessed by namespace and name. Provides methods to set value.

This interface can be used in action OwnCode (C# or PHP) of ProjectMaker.

Properties

Item

Property

IGlobalVariable Item { get; }

Item

Property

IEnumerable<IGlobalVariable> Item { get; }

Namespaces

Property

IEnumerable<string> Namespaces { get; }

Get the namespaces of global variables.

Methods

SetVariable

Method

void SetVariable(string nameSpace, string variableName, object value)

Sets value or create a new global variable by the specified pair, namespace and name.

If collection is not contains global variable with specified namespace and name, then a new global variable will be created and added to collection with the specified value.

Parameters

TypeNameDescription
stringnameSpace:http://msdn.microsoft.com/en-us/library/system.string.aspx The namespace of global variable.
stringvariableName:http://msdn.microsoft.com/en-us/library/system.string.aspx The name of global variable.
objectvalue:http://msdn.microsoft.com/en-us/library/system.object.aspx The name of global variable.

Example

// change a value of existing global variable
            project.GlobalVariables.SetVariable("MyNamespase", "ExistingVariableName", "ChangedValue");
             
            // create a new global variable and set value
            project.GlobalVariables.SetVariable("MyNamespase", "NewVariableName", "NewValue");

Example2

// change a value of existing global variable
            $project->GlobalVariables->SetVariable("MyNamespase", "ExistingVariableName", "ChangedValue");
             
            // create a new global variable and set value
            $project->GlobalVariables->SetVariable("MyNamespase", "NewVariableName", "NewValue");