IGlobalVariable

Assembly: ZennoLab.InterfacesLibrary
Full name: ZennoLab.InterfacesLibrary.ProjectModel.IGlobalVariable
Kind: interface


Represents the data of the global variable.

This interface can be used in action OwnCode of ProjectMaker.

Properties

Name

Property

string Name { get; set; }

Gets or sets name of global variable.

Example

// get global variable
            IGlobalVariable gv = project.GlobalVariables["MyNamespace", "MyGlobalVariable"];
             
            // get name of current global variable
            string name = gv.Name;
            // set name of global variable
            gv.Name = "NewName";

Example2

// get global variable
            $gv = $project->GlobalVariables->get_Item("MyNamespace", "MyGlobalVariable");
             
            // get name of current global variable
            $name = $gv->Name;
            // set name of global variable
            $gv->Name = "NewName";

Value

Property

object Value { get; set; }

Gets or sets value of global variable.

Example

// get global variable
            IGlobalVariable gv = project.GlobalVariables["MyNamespace", "MyGlobalVariable"];
             
            // get value of global variable
            object value = gv.Value;
             
            // set value of global variable
            gv.Value = 0;

Example2

// get global variable
            $gv = $project->GlobalVariables->get_Item("MyNamespace", "MyGlobalVariable");
             
            // get value of global variable
            $value = $gv->Value;
             
            // set value of global variable
            $gv->Value = 0;

Namespace

Property

string Namespace { get; set; }

Gets or sets namespace of global variable.

Example

// get global variable
            IGlobalVariable gv = project.GlobalVariables["MyNamespace", "MyGlobalVariable"];
             
            // get namespace of current global variable
            string @namespace = gv.Namespace;
            // set namespace of global variable
            gv.Namespace = "NewNamespace";

Example2

// get global variable
            $gv = $project->GlobalVariables->get_Item("MyNamespace", "MyGlobalVariable");
             
            // get namespace of current global variable
            $namespace = $gv->Namespace;
            // set namespace of global variable
            $gv->Namespace = "NewNamespace";

Comment

Property

string Comment { get; set; }

Gets or sets comment for global variable.

Example

// get global variable
            IGlobalVariable gv = project.GlobalVariables["MyNamespace", "MyGlobalVariable"];
             
            // get comment for current global variable
            string comment = gv.Comment;
            // set comment for global variable
            gv.Comment = "Set the comment for this global variable";

Example2

// get global variable
            $gv = $project->GlobalVariables->get_Item("MyNamespace", "MyGlobalVariable");
             
            // get comment for current global variable
            $comment = $gv->Comment;
            // set comment for global variable
            $gv->Comment = "Set the comment for this global variable";

Methods

ToString

Method

string ToString()

Returns a string that represents the current global variable.

Returns: :http://msdn.microsoft.com/en-us/library/system.string.aspx A string that represents the current global variable.

Example

// get global variable
            IGlobalVariable gv = project.GlobalVariables["MyNamespace", "MyGlobalVariable"];
             
            // convert global variable to string
            string stringGlobalVariable = gv.ToString();

Example2

// get global variable
            $gv = $project->GlobalVariables["MyNamespace", "MyGlobalVariable"];
             
            // convert global variable to string
            $stringGlobalVariable = $gv->ToString();