Пример #1
0
        public override string ToString()
        {
            var s = new StringBuilder();

            if (IsVariableInput)
            {
                s.Append("Variable input");
            }

            else if (IsConstantInput)
            {
                s.Append("Constant input");
            }

            else if (IsOutput)
            {
                s.Append("Output");
            }

            else if (IsVariableTemp)
            {
                s.Append("Variable temp");
            }

            else if (IsConstantTemp)
            {
                s.Append("Constant temp");
            }

            else
            {
                s.Append("Unknown data item type ");
            }

            s.Append(" data item ")
            .Append(ItemName)
            .Append("<")
            .Append(HlItemName)
            .Append(">")
            .Append(" : ")
            .Append(DataItemType.TypeSignature);

            //if (TestValueExpr != null)
            //    s.Append(" <Test Value = ")
            //        .Append(TestValueExpr)
            //        .Append(">");

            if (ReferenceEquals(AssignedRhsValue, null) == false)
            {
                s.Append(" = ")
                .AppendLine(AssignedRhsValue.ToString());
            }

            return(s.ToString());
        }
Пример #2
0
        /// <summary>
        /// Create an exact copy of this item
        /// </summary>
        /// <returns></returns>
        public LlDataItem Duplicate()
        {
            if (ReferenceEquals(AssignedRhsValue, null))
            {
                return new LlDataItem(ItemName, AssociatedValueAccess)//, TestValueExpr)
                       {
                           EvaluationOrder = EvaluationOrder,
                           IsDeleted       = IsDeleted
                       }
            }
            ;

            return(new LlDataItem(
                       ItemName,
                       AssociatedValueAccess,
                       (ValuePrimitive <MathematicaScalar>)AssignedRhsValue.DuplicateValue(true))//, TestValueExpr)
            {
                EvaluationOrder = EvaluationOrder,
                IsDeleted = IsDeleted
            });
        }