コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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)
            {
                _events    = that._events;
                _constr    = that._constr;
                _nameTable = that._nameTable;
                return(true);
            }
            return(false);
        }
コード例 #3
0
        /// <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());
        }
コード例 #4
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 public RtfTreeNavigator(RtfTreeNavigator that)
 {
     this.events    = that.events;
     this.constr    = that.constr;
     this.nameTable = that.nameTable;
 }
コード例 #5
0
        //-----------------------------------------------
        // 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;
        }
コード例 #6
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 public RtfTreeNavigator(RtfTreeNavigator that)
 {
     _events    = that._events;
     _constr    = that._constr;
     _nameTable = that._nameTable;
 }
コード例 #7
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;
        }