Caches sequence of XmlEvents so that they can be replayed later.
Inheritance: XmlRawWriter
 /// <summary>
 /// This constructor is internal so that external users cannot construct it (and therefore we do not have to test it separately).
 /// Initialize output state to accept Rtf content (top-level sequences are therefore prohibited).
 /// </summary>
 internal XmlQueryOutput(XmlQueryRuntime runtime, XmlEventCache xwrt) {
     this.runtime = runtime;
     this.xwrt = xwrt;
     this.xstate = XmlState.WithinContent;
     this.depth = 1;
     this.rootType = XPathNodeType.Root;
 }
Beispiel #2
0
 /// <summary>
 /// This constructor is internal so that external users cannot construct it (and therefore we do not have to test it separately).
 /// Initialize output state to accept Rtf content (top-level sequences are therefore prohibited).
 /// </summary>
 internal XmlQueryOutput(XmlQueryRuntime runtime, XmlEventCache xwrt)
 {
     _runtime = runtime;
     _xwrt = xwrt;
     _xstate = XmlState.WithinContent;
     _depth = 1;
     _rootType = XPathNodeType.Root;
 }
        //-----------------------------------------------
        // Constructors
        //-----------------------------------------------

        private XmlAutoDetectWriter(XmlWriterSettings writerSettings) {
            Debug.Assert(writerSettings.OutputMethod == XmlOutputMethod.AutoDetect);

            this.writerSettings = (XmlWriterSettings)writerSettings.Clone();
            this.writerSettings.ReadOnly = true;

            // Start caching all events
            this.eventCache = new XmlEventCache(string.Empty, true);
        }
Beispiel #4
0
        //-----------------------------------------------
        // Constructors
        //-----------------------------------------------

        private XmlAutoDetectWriter(XmlWriterSettings writerSettings)
        {
            Debug.Assert(writerSettings.OutputMethod == XmlOutputMethod.AutoDetect);

            _writerSettings          = (XmlWriterSettings)writerSettings.Clone();
            _writerSettings.ReadOnly = true;

            // Start caching all events
            _eventCache = new XmlEventCache(string.Empty, true);
        }
        //-----------------------------------------------
        // Constructors
        //-----------------------------------------------

        private XmlAutoDetectWriter(XmlWriterSettings writerSettings, Encoding encoding)
        {
            Debug.Assert(writerSettings.OutputMethod == XmlOutputMethod.AutoDetect);

            this.writerSettings          = writerSettings.Clone();
            this.writerSettings.Encoding = encoding;
            this.writerSettings.ReadOnly = true;

            // Start caching all events
            this.eventCache = new XmlEventCache(string.Empty, true);
        }
 private XmlAutoDetectWriter(XmlWriterSettings writerSettings)
 {
     this.writerSettings          = writerSettings.Clone();
     this.writerSettings.ReadOnly = true;
     this.eventCache = new XmlEventCache(string.Empty, true);
 }
        /// <summary>
        /// Create a document from the cache of events.  If a document has already been created previously, return it.
        /// This method is thread-safe, and is always guaranteed to return the exact same document, no matter how many
        /// threads have called it concurrently.
        /// </summary>
        public XPathNavigator GetNavigator(XmlEventCache events, XmlNameTable nameTable) {
            if (this.cache == null) {
                // Create XPathDocument from event cache
                XPathDocument doc = new XPathDocument(nameTable);
                XmlRawWriter writer = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames | (events.HasRootNode ? XPathDocument.LoadFlags.None : XPathDocument.LoadFlags.Fragment), events.BaseUri);

                events.EventsToWriter(writer);
                writer.Close();

                this.cache = doc;
            }

            return ((XPathDocument) this.cache).CreateNavigator();
        }
 /// <summary>
 /// Position this navigator to the same position as the "other" navigator.  If the "other" navigator
 /// is not of the same type as this navigator, then return false.
 /// </summary>
 public override bool MoveTo(XPathNavigator other) {
     RtfTreeNavigator that = other as RtfTreeNavigator;
     if (that != null) {
         this.events = that.events;
         this.constr = that.constr;
         this.nameTable = that.nameTable;
         return true;
     }
     return false;
 }
 /// <summary>
 /// Copy constructor.
 /// </summary>
 public RtfTreeNavigator(RtfTreeNavigator that) {
     this.events = that.events;
     this.constr = that.constr;
     this.nameTable = that.nameTable;
 }
        //-----------------------------------------------
        // Constructors
        //-----------------------------------------------

        /// <summary>
        /// Create a new navigator over the specified cache of Xml events.
        /// </summary>
        public RtfTreeNavigator(XmlEventCache events, XmlNameTable nameTable) {
            this.events = events;
            this.constr = new NavigatorConstructor();
            this.nameTable = nameTable;
        }
Beispiel #11
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 public RtfTreeNavigator(RtfTreeNavigator that)
 {
     _events = that._events;
     _constr = that._constr;
     _nameTable = that._nameTable;
 }
Beispiel #12
0
        //-----------------------------------------------
        // Constructors
        //-----------------------------------------------

        /// <summary>
        /// Create a new navigator over the specified cache of Xml events.
        /// </summary>
        public RtfTreeNavigator(XmlEventCache events, XmlNameTable nameTable)
        {
            _events = events;
            _constr = new NavigatorConstructor();
            _nameTable = nameTable;
        }
 private XmlAutoDetectWriter(XmlWriterSettings writerSettings)
 {
     this.writerSettings = writerSettings.Clone();
     this.writerSettings.ReadOnly = true;
     this.eventCache = new XmlEventCache(string.Empty, true);
 }