ZennoLab Assemblies Documentation
SetVariable Method
See Also  Example Send Feedback
ZennoLab.InterfacesLibrary Assembly > ZennoLab.InterfacesLibrary.ProjectModel.Collections Namespace > IGlobalVariables Interface : SetVariable Method
nameSpace
Type: System.String

The namespace of global variable.

variableName
Type: System.String

The name of global variable.

value
Type: System.Object

The name of global variable.

Glossary Item Box

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

Syntax

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

Parameters

nameSpace
Type: System.String

The namespace of global variable.

variableName
Type: System.String

The name of global variable.

value
Type: System.Object

The name of global variable.

Remarks

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.

Example

C#Copy Code
// 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");
PHPCopy Code
// 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");

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven

See Also

© 2013 All Rights Reserved.