public void DefineVariable(VariableInfo variableInfo) { if (variableInfo == null) throw new ArgumentNullException("variableInfo"); if (variables.ContainsKey(variableInfo.VariableName)) throw new ArgumentException(); var variable = new Variable(variableInfo); variables[variableInfo.VariableName] = variable; Scope.OnVariableDefined(variable); }
public static Variable DefineVariable(this ITransaction transaction, string name, DataType type) { var variableInfo = new VariableInfo(name, type, false); transaction.CreateObject(variableInfo); return transaction.GetVariable(name); }