IGlobalVariables

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


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

Get the global variable by the specified pair, namespace and name.

This property uses only for getting necessary global variable. For setting value need use method SetVariable.

Parameters

ПараметрОписание
nameSpace:http://msdn.microsoft.com/en-us/library/system.string.aspx The namespace of global variable.
variableName:http://msdn.microsoft.com/en-us/library/system.string.aspx The name of global variable.

Example

IGlobalVariable gv = project.GlobalVariables["MyNamespace", "MyGlobalVariable"];

Example2

$gv = $project->GlobalVariables->get_Item("MyNamespace", "MyGlobalVariable");

Item

Property

Get the global variables by the namespace.

This property uses only for getting necessary global variable. For setting value need use method SetVariable.

Parameters

ПараметрОписание
nameSpace:http://msdn.microsoft.com/en-us/library/system.string.aspx The namespace of global variable.

Namespaces

Property

Get the namespaces of global variables.

Methods

SetVariable

Method

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

ПараметрОписание
nameSpace:http://msdn.microsoft.com/en-us/library/system.string.aspx The namespace of global variable.
variableName:http://msdn.microsoft.com/en-us/library/system.string.aspx The name of global variable.
value: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");