ILocalVariable

Assembly: ZennoLab.InterfacesLibrary
Full name: ZennoLab.InterfacesLibrary.ProjectModel.ILocalVariable


Represents the data of the local variable.

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

Properties

Name

Property

Gets or sets name of local variable.

Example

// get local variable
            ILocalVariable lv = project.Variables["VariableName"];
             
            // get name of current local variable
            string name = lv.Name;
            // set name of local variable
            lv.Name = "NewName";

Example2

// get local variable
            $lv = $project->Variables->get_Item("VariableName");
             
            // get name of current local variable
            $name = $lv->Name;
            // set name of local variable
            $lv->Name = "NewName";

Value

Property

Gets or sets value of local variable.

Example

// get local variable
            ILocalVariable lv = project.Variables["VariableName"];
             
            // get value of local variable
            string value = lv.Value;
             
            // set value of local variable
            lv.Value = "0";

Example2

// get local variable
            $lv = $project->Variables->get_Item("VariableName");
             
            // get value of local variable
            $value = $lv->Value;
             
            // set value of local variable
            $lv->Value = "0";

Comment

Property

Gets or sets comment for local variable.

Example

// get local variable
            ILocalVariable lv = project.Variables["VariableName"];
             
            // get comment for current local variable
            string comment = lv.Comment;
            // set comment for local variable
            lv.Comment = "Set the comment for this local variable";

Example2

// get local variable
            $lv = $project->Variables->get_Item("VariableName");
             
            // get comment for current local variable
            $comment = $lv->Comment;
            // set comment for local variable
            $lv->Comment = "Set the comment for this local variable";

Group

Property

Gets or sets group of local variable.

This field used for determining type of variable. It can be auto-generated variable (this variables generated by ZennoPoster) or user-created variable.

Example

// get local variable
            ILocalVariable lv = project.Variables["VariableName"];
             
            // if variable is auto-generated
            if (lv.Group == VariableGroupTypeV4.AutoGenerated)
            {
                // show follow message
                System.Windows.Forms.MessageBox.Show(String.Format("Local variable {0} is auto-generated", lv.Name), 
                "Local variable type information");
            }
             
            // if variable is user-created
            if (lv.Group == VariableGroupTypeV4.UserDefined) 
            {
                // show follow message
                System.Windows.Forms.MessageBox.Show(String.Format("Local variable {0} is user-created", lv.Name), 
                "Local variable type information");
            }

Example2

// get local variable
            $lv = $project->Variables->get_Item("VariableName");
             
            // if variable is auto-generated
            if ($lv->Group == VariableGroupTypeV4::AutoGenerated)
            {
                // show follow message
                System\Windows\Forms\MessageBox::Show(String::Format("Local variable {0} is auto-generated", $lv->Name), 
                "Local variable type information");
            }
             
            // if variable is user-created
            if ($lv->Group == VariableGroupTypeV4::UserDefined) 
            {
                // show follow message
                System\Windows\Forms\MessageBox::Show(String::Format("Local variable {0} is user-created", $lv->Name), 
                "Local variable type information");
            }

Methods

ToString

Method

Returns a string that represents the current local variable.

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

Example

// get local variable
            ILocalVariable lv = project.Variables["VariableName"];
             
            // convert local variable to string
            string stringLocalVariable = lv.ToString();

Example2

// get local variable
            $lv = $project->Variables->get_Item("VariableName");
             
            // convert local variable to string
            $stringLocalVariable = $lv->ToString();