ZennoLab.InterfacesLibrary Assembly > ZennoLab.InterfacesLibrary.ProjectModel Namespace : IGlobalVariable Interface |
public interface IGlobalVariable
// 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));
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.