• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# XsltOld.ActionFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ActionFrame类属于System.Xml.Xsl.XsltOld命名空间,在下文中一共展示了ActionFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Execute

        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);
            object ParamValue;
            switch(frame.State) {
            case Initialized:           
                if (this.selectKey != Compiler.InvalidQueryKey) {
                    ParamValue = processor.RunQuery(frame, this.selectKey);
                    processor.SetParameter(this.name, ParamValue);
                    frame.Finished();
                }
                else {
                    if (this.containedActions == null) {
                        processor.SetParameter(this.name, string.Empty);
                        frame.Finished();
                        break;
                    }
                    NavigatorOutput output = new NavigatorOutput(baseUri);
                    processor.PushOutput(output);
                    processor.PushActionFrame(frame);
                    frame.State = ProcessingChildren;
                }
                break;
            case ProcessingChildren:
                RecordOutput recOutput = processor.PopOutput();
                Debug.Assert(recOutput is NavigatorOutput);
                processor.SetParameter(this.name,((NavigatorOutput)recOutput).Navigator);
                frame.Finished();
                break;
            default:
                Debug.Fail("Invalid execution state inside VariableAction.Execute");
		    break;
            }
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:33,代码来源:withparamaction.cs


示例2: Execute

        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    if (!_fallback)
                    {
                        throw XsltException.Create(SR.Xslt_UnknownExtensionElement, _name);
                    }
                    if (this.containedActions != null && this.containedActions.Count > 0)
                    {
                        processor.PushActionFrame(frame);
                        frame.State = ProcessingChildren;
                        break;
                    }
                    else goto case ProcessingChildren;
                case ProcessingChildren:
                    frame.Finished();
                    break;

                default:
                    Debug.Fail("Invalid Container action execution state");
                    break;
            }
        }
开发者ID:Corillian,项目名称:corefx,代码行数:27,代码来源:newinstructionaction.cs


示例3: 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


示例4: Execute

        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(this.copyEvents != null && this.copyEvents.Count > 0);

            switch (frame.State) {
            case Initialized:
                frame.Counter = 0;
                frame.State   = Outputting;
                goto case Outputting;

            case Outputting:
                Debug.Assert(frame.State == Outputting);

                while (processor.CanContinue) {
                    Debug.Assert(frame.Counter < this.copyEvents.Count);
                    Event copyEvent = (Event) this.copyEvents[frame.Counter];

                    if (copyEvent.Output(processor, frame) == false) {
                        // This event wasn't processed
                        break;
                    }

                    if (frame.IncrementCounter() >= this.copyEvents.Count) {
                        frame.Finished();
                        break;
                    }
                }
                break;
            default:
                Debug.Fail("Invalid CopyCodeAction execution state");
                break;
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:33,代码来源:CopyCodeAction.cs


示例5: Execute

 internal override void Execute(Processor processor, ActionFrame frame) {
     Debug.Assert(processor != null && frame != null);
     switch(frame.State) {
     case Initialized : 
         processor.ResetParams();
         if (this.containedActions != null && this.containedActions.Count > 0) {
             processor.PushActionFrame(frame);
             frame.State = ProcessedChildren;
             break;
         }
         goto case ProcessedChildren;
     case ProcessedChildren:
         TemplateAction action = processor.Stylesheet.FindTemplate(this.name);
         if (action != null) { 
             frame.State = ProcessedTemplate;
             processor.PushActionFrame(action, frame.NodeSet);
             break;
         }
         else {
             throw XsltException.Create(Res.Xslt_InvalidCallTemplate, this.name.ToString());
         }
     case ProcessedTemplate:
         frame.Finished();
         break;
     default:
         Debug.Fail("Invalid CallTemplateAction execution state");
         break;
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:29,代码来源:CallTemplateAction.cs


示例6: Execute

        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State) {
            case Initialized:
                if (this.type == ConditionType.ConditionIf || this.type == ConditionType.ConditionWhen) {
                    Debug.Assert(this.testKey != Compiler.InvalidQueryKey);
                    bool value = processor.EvaluateBoolean(frame, this.testKey);
                    if (value == false) {
                        frame.Finished();
                        break;
                    }
                }

                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;                              // Allow children to run

            case ProcessingChildren:
                if (this.type == ConditionType.ConditionWhen ||this.type == ConditionType.ConditionOtherwise) {
                    Debug.Assert(frame.Container != null);
                    frame.Exit();
                }

                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid IfAction execution state");
        		break;
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:32,代码来源:IfAction.cs


示例7: Execute

        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(frame.State == Initialized);

            Action action = null;

            if (this.mode != null) {
                action = importsOf == null 
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node, this.mode)
                    : importsOf.FindTemplateImports(processor, frame.Node, this.mode);
            }
            else {
                action = importsOf == null 
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node)
                    : importsOf.FindTemplateImports(processor, frame.Node);
            }

            // Built-int template rules
            if (action == null) {
                action = BuiltInTemplate(frame.Node);
            }

            // Jump
            if (action != null) {
                frame.SetAction(action);
            }
            else {
                frame.Finished();
            }
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:30,代码来源:templatelookupaction.cs


示例8: Execute

        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    Debug.Assert(frame != null);
                    Debug.Assert(frame.NodeSet != null);

                    string value = processor.ValueOf(frame, _selectKey);

                    if (processor.TextEvent(value, _disableOutputEscaping))
                    {
                        frame.Finished();
                    }
                    else
                    {
                        frame.StoredOutput = value;
                        frame.State = ResultStored;
                    }
                    break;

                case ResultStored:
                    Debug.Assert(frame.StoredOutput != null);
                    processor.TextEvent(frame.StoredOutput);
                    frame.Finished();
                    break;

                default:
                    Debug.Fail("Invalid ValueOfAction execution state");
                    break;
            }
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:34,代码来源:ValueOfAction.cs


示例9: Execute

        internal override void Execute(Processor processor, ActionFrame frame)
        {
            switch (frame.State)
            {
                case Initialized:
                    frame.Counter = 0;
                    frame.State = ProcessingSets;
                    goto case ProcessingSets;

                case ProcessingSets:
                    if (frame.Counter < _useAttributeSets.Length)
                    {
                        AttributeSetAction action = processor.RootAction.GetAttributeSet(_useAttributeSets[frame.Counter]);
                        frame.IncrementCounter();
                        processor.PushActionFrame(action, frame.NodeSet);
                    }
                    else
                    {
                        frame.Finished();
                    }
                    break;

                default:
                    Debug.Fail("Invalid Container action execution state");
                    break;
            }
        }
开发者ID:Corillian,项目名称:corefx,代码行数:27,代码来源:UseAttributeSetsAction.cs


示例10: Execute

        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);
            switch (frame.State) {
            case Initialized:
                TextOnlyOutput output = new TextOnlyOutput(processor, new StringWriter(CultureInfo.InvariantCulture));
                processor.PushOutput(output);
                processor.PushActionFrame(frame);
                frame.State = ProcessingChildren;
                break;

            case ProcessingChildren:
                TextOnlyOutput recOutput = processor.PopOutput() as TextOnlyOutput;
                Debug.Assert(recOutput != null);
                Console.WriteLine(recOutput.Writer.ToString());

                if (_Terminate) {
                    throw XsltException.Create(Res.Xslt_Terminate, recOutput.Writer.ToString());
                }
                frame.Finished();
                break;
            
            default:
                Debug.Fail("Invalid MessageAction execution state");
                break;
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:26,代码来源:MessageAction.cs


示例11: 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


示例12: Execute

        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    if (_nameAvt == null)
                    {
                        frame.StoredOutput = _name;
                        if (_name == null)
                        {
                            // name was static but was bad;
                            frame.Finished();
                            break;
                        }
                    }
                    else
                    {
                        frame.StoredOutput = _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:geoffkizer,项目名称:corefx,代码行数:54,代码来源:ProcessingInstructionAction.cs


示例13: 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


示例14: Execute

 internal override void Execute(Processor processor, ActionFrame frame) {
     Debug.Assert(processor != null && frame != null);
     switch (frame.State) {
     case Initialized:
         processor.PushTemplateLookup(frame.NodeSet, this.mode, /*importsOf:*/this.stylesheet);
         frame.State = TemplateProcessed;
         break;
     case TemplateProcessed:
         frame.Finished();
         break;
     }
 }
开发者ID:uQr,项目名称:referencesource,代码行数:12,代码来源:ApplyImportsAction.cs


示例15: Execute

        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    Debug.Assert(frame.NodeSet != null);
                    Query query = processor.GetValueQuery(_selectKey);
                    object result = query.Evaluate(frame.NodeSet);

                    if (result is XPathNodeIterator)
                    {
                        // we cash this query because otherwise current() works incorrectly. Bug#382166.
                        // To be perfect we should use frame.NewNodeSet here
                        processor.PushActionFrame(CopyNodeSetAction.GetAction(), new XPathArrayIterator(query));
                        frame.State = NodeSetCopied;
                        break;
                    }

                    XPathNavigator nav = result as XPathNavigator;
                    if (nav != null)
                    {
                        processor.PushActionFrame(CopyNodeSetAction.GetAction(), new XPathSingletonIterator(nav));
                        frame.State = NodeSetCopied;
                        break;
                    }

                    string value = XmlConvert.ToXPathString(result);
                    if (processor.TextEvent(value))
                    {
                        frame.Finished();
                    }
                    else
                    {
                        frame.StoredOutput = value;
                        frame.State = ResultStored;
                    }
                    break;

                case ResultStored:
                    Debug.Assert(frame.StoredOutput != null);
                    processor.TextEvent(frame.StoredOutput);
                    frame.Finished();
                    break;

                case NodeSetCopied:
                    Debug.Assert(frame.State == NodeSetCopied);
                    frame.Finished();
                    break;
            }
        }
开发者ID:Corillian,项目名称:corefx,代码行数:52,代码来源:CopyOfAction.cs


示例16: Execute

        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    if (_sortContainer != null)
                    {
                        processor.InitSortArray();
                        processor.PushActionFrame(_sortContainer, frame.NodeSet);
                        frame.State = ProcessedSort;
                        break;
                    }
                    goto case ProcessedSort;
                case ProcessedSort:
                    frame.InitNewNodeSet(processor.StartQuery(frame.NodeSet, _selectKey));
                    if (_sortContainer != null)
                    {
                        Debug.Assert(processor.SortArray.Count != 0);
                        frame.SortNewNodeSet(processor, processor.SortArray);
                    }
                    frame.State = ProcessNextNode;
                    goto case ProcessNextNode;

                case ProcessNextNode:
                    Debug.Assert(frame.State == ProcessNextNode);
                    Debug.Assert(frame.NewNodeSet != null);

                    if (frame.NewNextNode(processor))
                    {
                        frame.State = PositionAdvanced;
                        goto case PositionAdvanced;
                    }
                    else
                    {
                        frame.Finished();
                        break;
                    }

                case PositionAdvanced:
                    processor.PushActionFrame(frame, frame.NewNodeSet);
                    frame.State = ContentsProcessed;
                    break;

                case ContentsProcessed:
                    frame.State = ProcessNextNode;
                    goto case ProcessNextNode;
            }
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:50,代码来源:ForEachAction.cs


示例17: Execute

        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State) {
            case Initialized:
                if (processor.TextEvent(this.text, disableOutputEscaping)) {
                    frame.Finished();
                }
                break;

            default:
                Debug.Fail("Invalid execution state in TextAction");
                break;
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:15,代码来源:TextAction.cs


示例18: Evaluate

        internal string Evaluate(Processor processor, ActionFrame frame) {
            if (IsConstant) {
                Debug.Assert(constAvt != null);
                return constAvt;
            }
            else {
                Debug.Assert(processor != null && frame != null);

                StringBuilder builder = processor.GetSharedStringBuilder();

                for(int i = 0; i < events.Length; i ++) {
                    builder.Append(events[i].Evaluate(processor, frame));
                }
                processor.ReleaseSharedStringBuilder();
                return builder.ToString();
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:17,代码来源:Avt.cs


示例19: 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.HasAttributes || frame.Node.MoveToFirstAttribute() == false) {
                        frame.Finished();
                        break;
                    }

                    frame.State   = BeginEvent;
                    goto case BeginEvent;

                case BeginEvent:
                    Debug.Assert(frame.State == BeginEvent);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Attribute);

                    if (SendBeginEvent(processor, frame.Node) == false) {
                        // This one wasn't output
                        break;
                    }
                    frame.State = TextEvent;
                    continue;

                case TextEvent:
                    Debug.Assert(frame.State == TextEvent);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Attribute);

                    if (SendTextEvent(processor, frame.Node) == false) {
                        // This one wasn't output
                        break;
                    }
                    frame.State = EndEvent;
                    continue;

                case EndEvent:
                    Debug.Assert(frame.State == EndEvent);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Attribute);

                    if (SendEndEvent(processor, frame.Node) == false) {
                        // This one wasn't output
                        break;
                    }
                    frame.State = Advance;
                    continue;

                case Advance:
                    Debug.Assert(frame.State == Advance);
                    Debug.Assert(frame.Node.NodeType == XPathNodeType.Attribute);

                    if (frame.Node.MoveToNextAttribute()) {
                        frame.State = BeginEvent;
                        continue;
                    }
                    else {
                        frame.Node.MoveToParent();
                        frame.Finished();
                        break;
                    }
                }
                break;
            }// while (processor.CanContinue)
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:64,代码来源:CopyAttributesAction.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XsltOld.Compiler类代码示例发布时间:2022-05-26
下一篇:
C# Qil.QilUnary类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap