Пример #1
0
            public ContinuationList(IPromiseContinuation continuation, ContinuationList previous = null)
            {
                _continuation = continuation;
                _previous     = previous;

                if (previous == null)
                {
                    _count = 1;
                }
                else
                {
                    _count = previous._count + 1;
                }
            }
        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpAsLongAsInstruction"/> class.
        /// </summary>
        /// <param name="context">The creation context.</param>
        /// <param name="parentFeature">The parent feature.</param>
        /// <param name="source">The Easly instruction from which the C# instruction is created.</param>
        protected CSharpAsLongAsInstruction(ICSharpContext context, ICSharpFeature parentFeature, IAsLongAsInstruction source)
            : base(context, parentFeature, source)
        {
            ContinueCondition = CSharpExpression.Create(context, (IExpression)source.ContinueCondition);

            foreach (IContinuation Continuation in source.ContinuationList)
            {
                ICSharpContinuation NewContinuation = CSharpContinuation.Create(context, parentFeature, Continuation);
                ContinuationList.Add(NewContinuation);
            }

            if (source.ElseInstructions.IsAssigned)
            {
                ElseInstructions = CSharpScope.Create(context, parentFeature, (IScope)source.ElseInstructions.Item);
            }
        }