System.Xml.Xsl.XsltOld.RecordBuilder.EndEvent C# (CSharp) Method

EndEvent() private method

private EndEvent ( int state, XPathNodeType nodeType ) : Processor.OutputResult
state int
nodeType XPathNodeType
return Processor.OutputResult
        internal Processor.OutputResult EndEvent(int state, XPathNodeType nodeType) {
            if (! CanOutput(state)) {
                return Processor.OutputResult.Overflow;
            }

            AdjustDepth(state);
            PopElementScope();
            this.popScope = (state & StateMachine.PopScope) != 0;

            if ((state & StateMachine.EmptyTag) != 0 && this.mainNode.IsEmptyTag == true) {
                return Processor.OutputResult.Continue;
            }

            ResetRecord(state);

            if ((state & StateMachine.BeginRecord) != 0) {
                if(nodeType == XPathNodeType.Element) {
                    EndElement();
                }
            }

            return CheckRecordEnd(state);
        }

Usage Example

Ejemplo n.º 1
0
        internal bool EndEvent(XPathNodeType nodeType)
        {
            Debug.Assert(_xsm != null);

            if (_ignoreLevel > 0)
            {
                _ignoreLevel--;
                return(true);
            }

            int stateOutlook = _xsm.EndOutlook(nodeType);

            switch (_builder.EndEvent(stateOutlook, nodeType))
            {
            case OutputResult.Continue:
                _xsm.End(nodeType);
                Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
                return(true);

            case OutputResult.Interrupt:
                _xsm.End(nodeType);
                Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State,
                             "StateMachine.StateOnly(stateOutlook) == this.xsm.State");
                ExecutionResult = ExecResult.Interrupt;
                return(true);

            case OutputResult.Overflow:
                ExecutionResult = ExecResult.Interrupt;
                return(false);

            case OutputResult.Error:
            case OutputResult.Ignore:
            default:
                Debug.Fail("Unexpected result of RecordBuilder.TextEvent()");
                return(true);
            }
        }