ZennoLab Assemblies Documentation
IGlobalVariable Interface
Members  Example 
Represents the data of the global variable.
Object Model
IGlobalVariable Interface
Syntax
public interface IGlobalVariable 
Remarks
This interface can be used in action OwnCode of ProjectMaker.
Example
The following code using IGlobalVariable Interface for getting information about global variable.
// get a global variable
IGlobalVariable gv = project.GlobalVariables["MyNamespace", "MyGlobalVariable"];
 
// get comment for current global variable
string comment = gv.Comment;
// if value is empty then set comment for global variable
if (String.IsNullOrWhiteSpace(comment)) gv.Comment = "Set the comment for this global variable";
 
// get name of global variable
string name = gv.Name;
// get namespace of global variable
string @namespace = gv.Namespace;
// get value of global variable
object value = gv.Value;
 
// show message about variable
System.Windows.Forms.MessageBox.Show(String.Format("Global variable value is {0}; comment {1}", value, comment), 
        String.Format("Information about variable {0} from namespace {1}", name, @namespace));
// get a global variable
$gv = $project->GlobalVariables->get_Item("MyNamespace", "MyGlobalVariable");
 
// get comment for current global variable
$comment = $gv->Comment;
// if value is empty then set comment for global variable
if (String::IsNullOrWhiteSpace($comment)) $gv->Comment = "Set the comment for this global variable";
 
// get name of global variable
$name = $gv->Name;
// get namespace of global variable
$namespace = $gv->Namespace;
// get value of global variable
$value = $gv->Value;
 
// show message about variable
System\Windows\Forms\MessageBox::Show(String::Format("Global variable: value is {0}; comment {1}", $value, $comment), 
        String::Format("Information about variable {0} from namespace {1}", $name, $namespace));
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

IGlobalVariable Members
ZennoLab.InterfacesLibrary.ProjectModel Namespace
IGlobalVariables Interface

Send Feedback