Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
 /// </summary>
 /// <param name="stream">The input stream.</param>
 /// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the stream.</param>
 public HtmlNodeNavigator(Stream stream, bool detectEncodingFromByteOrderMarks)
 {
     _doc       = new HtmlDocument();
     _nametable = new HtmlNameTable();
     _doc.Load(stream, detectEncodingFromByteOrderMarks);
     Reset();
 }
Beispiel #2
0
        internal HtmlNodeNavigator(HtmlDocument doc, HtmlNode currentNode)
        {
            if (currentNode == null)
            {
                throw new ArgumentNullException("currentNode");
            }

            if (currentNode.OwnerDocument != doc)
            {
                throw new ArgumentException(HtmlDocument.HtmlExceptionRefNotChild);
            }

            if (doc == null)
            {
                // keep in message, currentNode.OwnerDocument also null.
                throw new Exception("Oops! The HtmlDocument cannot be null.");
            }

#if TRACE_NAVIGATOR
            InternalTrace(null);
#endif

            _doc       = doc;
            _nametable = new HtmlNameTable();
            Reset();
            _currentnode = currentNode;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
 /// </summary>
 /// <param name="stream">The input stream.</param>
 public HtmlNodeNavigator(Stream stream)
 {
     _doc       = new HtmlDocument();
     _nametable = new HtmlNameTable();
     _doc.Load(stream);
     Reset();
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
 /// </summary>
 /// <param name="path">The complete file path to be read.</param>
 /// <param name="encoding">The character encoding to use.</param>
 /// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
 /// <param name="buffersize">The minimum buffer size.</param>
 public HtmlNodeNavigator(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)
 {
     _doc       = new HtmlDocument();
     _nametable = new HtmlNameTable();
     _doc.Load(path, encoding, detectEncodingFromByteOrderMarks, buffersize);
     Reset();
 }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
 /// </summary>
 /// <param name="path">The complete file path to be read.</param>
 /// <param name="encoding">The character encoding to use.</param>
 public HtmlNodeNavigator(string path, Encoding encoding)
 {
     _doc       = new HtmlDocument();
     _nametable = new HtmlNameTable();
     _doc.Load(path, encoding);
     Reset();
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader.
 /// </summary>
 /// <param name="reader">The TextReader used to feed the HTML data into the document.</param>
 public HtmlNodeNavigator(TextReader reader)
 {
     _doc       = new HtmlDocument();
     _nametable = new HtmlNameTable();
     _doc.Load(reader);
     Reset();
 }
Beispiel #7
0
        private HtmlNodeNavigator(HtmlNodeNavigator nav)
        {
            if (nav == null)
            {
                throw new ArgumentNullException("nav");
            }
#if TRACE_NAVIGATOR
            InternalTrace(null);
#endif
            _doc         = nav._doc;
            _currentnode = nav._currentnode;
            _attindex    = nav._attindex;
            _nametable   = nav._nametable;           // REVIEW: should we do this?
        }
Beispiel #8
0
 internal HtmlNodeNavigator()
 {
     _doc       = new HtmlDocument();
     _nametable = new HtmlNameTable();
     Reset();
 }