Beispiel #1
0
        /// <summary>
        /// Closes the current input object, indicating that its transformation has been completed.
        /// </summary>
        protected virtual void Close(object inputItem)
        {
            if (InputStack.Count == 0)
            {
                throw new InvalidOperationException("Cannot close: stack is already empty.");
            }
            TransformInfo ti = InputStack[InputStack.Count - 1];

            if (!object.ReferenceEquals(inputItem, ti.inputElement))
            {
                throw new InvalidOperationException("Cannot close: supplied object is not on top of the stack: " + inputItem + "," + ti.inputElement);
            }
            InputStack.RemoveAt(InputStack.Count - 1);
        }
Beispiel #2
0
        /// <summary>
        /// Opens the input object for transforming.
        /// </summary>
        /// <param name="inputItem">Input code element</param>
        protected virtual void Open(object inputItem)
        {
            TransformInfo ti = new TransformInfo(inputItem);

            InputStack.Add(ti);
        }