internal bool BeginEvent(XPathNodeType nodeType, string prefix, string name, string nspace, bool empty, Object htmlProps, bool search)
{
Debug.Assert(this.xsm != null);
int stateOutlook = this.xsm.BeginOutlook(nodeType);
if (this.ignoreLevel > 0 || stateOutlook == StateMachine.Error)
{
this.ignoreLevel++;
return(true); // We consumed the event, so pretend it was output.
}
switch (this.builder.BeginEvent(stateOutlook, nodeType, prefix, name, nspace, empty, htmlProps, search))
{
case OutputResult.Continue:
this.xsm.Begin(nodeType);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == this.xsm.State);
Debug.Assert(ExecutionResult == ExecResult.Continue);
return(true);
case OutputResult.Interrupt:
this.xsm.Begin(nodeType);
Debug.Assert(StateMachine.StateOnly(stateOutlook) == this.xsm.State);
ExecutionResult = ExecResult.Interrupt;
return(true);
case OutputResult.Overflow:
ExecutionResult = ExecResult.Interrupt;
return(false);
case OutputResult.Error:
this.ignoreLevel++;
return(true);
case OutputResult.Ignore:
return(true);
default:
Debug.Fail("Unexpected result of RecordBuilder.BeginEvent()");
return(true);
}
}