Beispiel #1
0
        public Variable ExplicitConvert(Variable variable, NType targetType)
        {
            Debug.Assert(variable.Type == this);
            var retVariable = this.ExplicitConvertFunc(variable, targetType);

            if (Object.ReferenceEquals(retVariable, variable))
            {
                return(retVariable);
            }

            // add connection
            var newCon = new VariableConnection()
            {
                OperationType = VariableOperationType.TypeCast_Trim
            };

            newCon.InVariables.Add(variable);
            newCon.OutVariables.Add(retVariable);

            retVariable.ParentConnections.Add(newCon);

            return(retVariable);
        }
Beispiel #2
0
 public Variable Assign(Variable variable, NType type)
 {
     return(this.ImplicitConvert(variable, type));
 }