本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例12: TextOnlyOutput
internal TextOnlyOutput(Processor processor, TextWriter writer) {
if (writer == null) {
throw new ArgumentNullException("writer");
}
this.processor = processor;
this.writer = writer;
}
示例13: ReaderOutput
internal ReaderOutput(Processor processor) {
Debug.Assert(processor != null);
Debug.Assert(processor.NameTable != null);
this.processor = processor;
this.nameTable = processor.NameTable;
Reset();
}
示例14: WriterOutput
internal WriterOutput(Processor processor, XmlWriter writer)
{
if (writer == null)
{
throw new ArgumentNullException(nameof(writer));
}
_writer = writer;
_processor = processor;
}
示例15: TextOutput
internal TextOutput(Processor processor, TextWriter writer)
: base(processor)
{
if (writer == null) {
throw new ArgumentNullException("writer");
}
this.encoding = writer.Encoding;
this.writer = writer;
}