예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpExpressionContext"/> class.
        /// </summary>
        /// <param name="destinationNameList">The list of variables to use as destination.</param>
        public CSharpExpressionContext(IList <ICSharpVariableContext> destinationNameList)
        {
            DestinationNameList = destinationNameList;

            foreach (ICSharpVariableContext Item in DestinationNameList)
            {
                CompleteDestinationNameList.Add(Item.Name);
            }
        }
예제 #2
0
        /// <summary>
        /// Sets results of an expression, with one of them the returned value.
        /// </summary>
        /// <param name="outgoingResultList">The list of results.</param>
        /// <param name="returnValueIndex">The expression return value in plain text.</param>
        public void SetMultipleResult(IList <string> outgoingResultList, int returnValueIndex)
        {
            for (int i = 0; i < outgoingResultList.Count; i++)
            {
                string OutgoingResult = outgoingResultList[i];

                if (i != returnValueIndex)
                {
                    CompleteDestinationNameList.Add(OutgoingResult);
                }
                else
                {
                    ReturnValue    = OutgoingResult;
                    OutgoingResult = null;
                }

                if (i < DestinationNameList.Count)
                {
                    FilledDestinationTable.Add(DestinationNameList[i].Name, OutgoingResult);
                }
            }

            ReturnValueIndex = returnValueIndex;
        }