Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
 }