04-26-2013 12:27 AM
Hey,
i'm trying to start using Measurement Studio, but can't remember where i could rename the Network-Variables.
As you can see i began renaming some in the past, but i can't figure out where i could do this again to have more consistency.
Thanks for your help
04-26-2013 10:22 AM
There's no one-step process to rename a variable. It can be achieved by making a new variable with the same configuration but a different name. For example, this will have the same effect as renaming a variable:
private void RenameVariable(ServerVariableInfo variable, string newName) { var newOptions = new VariableCreationOptions(variable.Process.Name, newName); newOptions.Description = variable.Description; newOptions.ItemCapacity = variable.ItemCapacity; newOptions.SingleWriter = variable.SingleWriter; newOptions.VariableType = variable.VariableType; variable.Process.CreateVariable(newOptions); variable.Delete(); }
Unfortunately, if the variable was one of the more exotic kinds of network variable item and had properties that aren't exposed by the ServerVariableInfo class, this won't carry those properties over to the new item.