当前位置: 首页>>代码示例>>C#>>正文


C# Processor.BeginEvent方法代码示例

本文整理汇总了C#中System.Xml.Xsl.XsltOld.Processor.BeginEvent方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.BeginEvent方法的具体用法?C# Processor.BeginEvent怎么用?C# Processor.BeginEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Xsl.XsltOld.Processor的用法示例。


在下文中一共展示了Processor.BeginEvent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
            }
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:27,代码来源:commentaction.cs

示例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;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:NamespaceEvent.cs

示例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
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:53,代码来源:CopyNamespacesAction.cs

示例4: SendBeginEvent

 private static bool SendBeginEvent(Processor processor, XPathNavigator node) {
     Debug.Assert(node.NodeType == XPathNodeType.Attribute);
     return processor.BeginEvent(XPathNodeType.Attribute, node.Prefix, node.LocalName, node.NamespaceURI, false);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:CopyAttributesAction.cs

示例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;
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:46,代码来源:AttributeAction.cs

示例6: 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;
            }
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:46,代码来源:processinginstructionaction.cs

示例7: Output

 public override bool Output(Processor processor, ActionFrame frame) {
     return processor.BeginEvent(this.nodeType, this.prefix, this.name, this.namespaceUri, this.empty, this.htmlProps, false);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:BeginEvent.cs

示例8: Output

 public override bool Output(Processor processor, ActionFrame frame)
 {
     return processor.BeginEvent(_nodeType, _prefix, _name, _namespaceUri, _empty, _htmlProps, false);
 }
开发者ID:Corillian,项目名称:corefx,代码行数:4,代码来源:BeginEvent.cs

示例9: 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;
            }
        }
开发者ID:Corillian,项目名称:corefx,代码行数:55,代码来源:ElementAction.cs


注:本文中的System.Xml.Xsl.XsltOld.Processor.BeginEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。