本文整理汇总了C#中System.Xml.Xsl.XsltOld.Processor.EndEvent方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.EndEvent方法的具体用法?C# Processor.EndEvent怎么用?C# Processor.EndEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.XsltOld.Processor
的用法示例。
在下文中一共展示了Processor.EndEvent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
internal override void Execute(Processor processor, ActionFrame frame) {
Debug.Assert(processor != null && frame != null);
switch (frame.State) {
case Initialized:
if (processor.BeginEvent(XPathNodeType.Comment, string.Empty, string.Empty, string.Empty, false) == false) {
// Come back later
break;
}
processor.PushActionFrame(frame);
frame.State = ProcessingChildren;
break; // Allow children to run
case ProcessingChildren:
if (processor.EndEvent(XPathNodeType.Comment) == false) {
break;
}
frame.Finished();
break;
default:
Debug.Fail("Invalid IfAction execution state");
break;
}
}
示例2: Output
public override bool Output(Processor processor, ActionFrame frame) {
bool res;
res = processor.BeginEvent(XPathNodeType.Namespace, /*prefix:*/null, this.name, this.namespaceUri, /*empty:*/false);
Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change
res = processor.EndEvent(XPathNodeType.Namespace);
Debug.Assert(res);
return true;
}
示例3: Execute
internal override void Execute(Processor processor, ActionFrame frame) {
Debug.Assert(processor != null && frame != null);
while (processor.CanContinue) {
switch (frame.State) {
case Initialized:
if (frame.Node.MoveToFirstNamespace(XPathNamespaceScope.ExcludeXml) == false) {
frame.Finished();
break;
}
frame.State = BeginEvent;
goto case BeginEvent;
case BeginEvent:
Debug.Assert(frame.State == BeginEvent);
Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);
if (processor.BeginEvent(XPathNodeType.Namespace, null, frame.Node.LocalName, frame.Node.Value, false) == false) {
// This one wasn't output
break;
}
frame.State = EndEvent;
continue;
case EndEvent:
Debug.Assert(frame.State == EndEvent);
Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);
if (processor.EndEvent(XPathNodeType.Namespace) == false) {
// This one wasn't output
break;
}
frame.State = Advance;
continue;
case Advance:
Debug.Assert(frame.State == Advance);
Debug.Assert(frame.Node.NodeType == XPathNodeType.Namespace);
if (frame.Node.MoveToNextNamespace(XPathNamespaceScope.ExcludeXml)) {
frame.State = BeginEvent;
continue;
}
else {
frame.Node.MoveToParent();
frame.Finished();
break;
}
}
break;
}// while
}
示例4: SendEndEvent
private static bool SendEndEvent(Processor processor, XPathNavigator node) {
Debug.Assert(node.NodeType == XPathNodeType.Attribute);
return processor.EndEvent(XPathNodeType.Attribute);
}
示例5: Execute
internal override void Execute(Processor processor, ActionFrame frame) {
Debug.Assert(processor != null && frame != null);
switch (frame.State) {
case Initialized:
if(this.qname != null) {
frame.CalulatedName = this.qname;
}
else {
frame.CalulatedName = CreateAttributeQName(
this.nameAvt == null ? this.name : this.nameAvt.Evaluate(processor, frame),
this.nsAvt == null ? this.nsUri : this.nsAvt .Evaluate(processor, frame),
this.manager
);
if(frame.CalulatedName == null) {
// name == "xmlns" case. Ignore xsl:attribute
frame.Finished();
break;
}
}
goto case NameDone;
case NameDone :
{
PrefixQName qname = frame.CalulatedName;
if (processor.BeginEvent(XPathNodeType.Attribute, qname.Prefix, qname.Name, qname.Namespace, false) == false) {
// Come back later
frame.State = NameDone;
break;
}
processor.PushActionFrame(frame);
frame.State = ProcessingChildren;
break; // Allow children to run
}
case ProcessingChildren:
if (processor.EndEvent(XPathNodeType.Attribute) == false) {
frame.State = ProcessingChildren;
break;
}
frame.Finished();
break;
default:
Debug.Fail("Invalid ElementAction execution state");
break;
}
}
示例6: Output
public override bool Output(Processor processor, ActionFrame frame) {
return processor.EndEvent(this.nodeType);
}
示例7: Execute
internal override void Execute(Processor processor, ActionFrame frame) {
Debug.Assert(processor != null && frame != null);
switch (frame.State) {
case Initialized:
if(this.nameAvt == null) {
frame.StoredOutput = this.name;
if(this.name == null) {
// name was static but was bad;
frame.Finished();
break;
}
}
else {
frame.StoredOutput = this.nameAvt.Evaluate(processor, frame);
if (! IsProcessingInstructionName(frame.StoredOutput)) {
frame.Finished();
break;
}
}
goto case NameReady;
case NameReady:
Debug.Assert(frame.StoredOutput != null);
if (processor.BeginEvent(XPathNodeType.ProcessingInstruction, string.Empty, frame.StoredOutput, string.Empty, false) == false) {
// Come back later
frame.State = NameReady;
break;
}
processor.PushActionFrame(frame);
frame.State = ProcessingChildren;
break; // Allow children to run
case ProcessingChildren:
if (processor.EndEvent(XPathNodeType.ProcessingInstruction) == false) {
frame.State = ProcessingChildren;
break;
}
frame.Finished();
break;
default:
Debug.Fail("Invalid ElementAction execution state");
frame.Finished();
break;
}
}
示例8: Execute
internal override void Execute(Processor processor, ActionFrame frame)
{
Debug.Assert(processor != null && frame != null);
switch (frame.State)
{
case Initialized:
if (_qname != null)
{
frame.CalulatedName = _qname;
}
else
{
frame.CalulatedName = CreateElementQName(
_nameAvt == null ? _name : _nameAvt.Evaluate(processor, frame),
_nsAvt == null ? _nsUri : _nsAvt.Evaluate(processor, frame),
_manager
);
}
goto case NameDone;
case NameDone:
{
PrefixQName qname = frame.CalulatedName;
if (processor.BeginEvent(XPathNodeType.Element, qname.Prefix, qname.Name, qname.Namespace, _empty) == false)
{
// Come back later
frame.State = NameDone;
break;
}
if (!_empty)
{
processor.PushActionFrame(frame);
frame.State = ProcessingChildren;
break; // Allow children to run
}
else
{
goto case ProcessingChildren;
}
}
case ProcessingChildren:
if (processor.EndEvent(XPathNodeType.Element) == false)
{
frame.State = ProcessingChildren;
break;
}
frame.Finished();
break;
default:
Debug.Fail("Invalid ElementAction execution state");
break;
}
}