1 //------------------------------------------------------------------------------
2 // <copyright file="TextEvent.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
7 
8 namespace System.Xml.Xsl.XsltOld {
9     using Res = System.Xml.Utils.Res;
10     using System;
11     using System.Diagnostics;
12     using System.Xml;
13     using System.Xml.XPath;
14 
15     internal class TextEvent : Event {
16         private string text;
17 
TextEvent()18         protected TextEvent() {}
19 
TextEvent(string text)20         public TextEvent(string text) {
21             Debug.Assert(text != null);
22             this.text = text;
23         }
24 
TextEvent(Compiler compiler)25         public TextEvent(Compiler compiler) {
26             NavigatorInput input = compiler.Input;
27             Debug.Assert(input.NodeType == XPathNodeType.Text || input.NodeType == XPathNodeType.SignificantWhitespace);
28             this.text = input.Value;
29         }
30 
Output(Processor processor, ActionFrame frame)31         public override bool Output(Processor processor, ActionFrame frame) {
32             return processor.TextEvent(this.text);
33         }
34 
Evaluate(Processor processor, ActionFrame frame)35         public virtual string Evaluate(Processor processor, ActionFrame frame) {
36             return this.text;
37         }
38     }
39 }
40