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


C# XsltOld.Processor类代码示例

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


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

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

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

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

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

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

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

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

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

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

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

        internal TextOnlyOutput(Processor processor, TextWriter writer) {
            if (writer == null) {
                throw new ArgumentNullException("writer");
            }

            this.processor  = processor;
            this.writer     = writer;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:TextOnlyOutput.cs

示例13: ReaderOutput

        internal ReaderOutput(Processor processor) {
            Debug.Assert(processor != null);
            Debug.Assert(processor.NameTable != null);

            this.processor = processor;
            this.nameTable = processor.NameTable;

            Reset();
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:readeroutput.cs

示例14: WriterOutput

        internal WriterOutput(Processor processor, XmlWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            _writer = writer;
            _processor = processor;
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:10,代码来源:WriterOutput.cs

示例15: TextOutput

        internal TextOutput(Processor processor, TextWriter writer)
            : base(processor) 
        {
            if (writer == null) {
                throw new ArgumentNullException("writer");
            }

            this.encoding = writer.Encoding;
            this.writer   = writer;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:TextOutput.cs


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