Exemple #1
0
        /// <summary>
        /// 从指定 HTML 创建一个 DomFragment 实例
        /// </summary>
        /// <param name="manager">文档碎片管理器</param>
        /// <param name="html">要分析成碎片的原始 HTML 文本</param>
        public DomFragment( DomFragmentManager manager, string html )
            : this(manager)
        {
            var parser = manager.GetParser();

              parser.ParseToFragment( html, this );
        }
Exemple #2
0
        /// <summary>
        /// 从指定 HTML 创建一个 DomFragment 实例
        /// </summary>
        /// <param name="manager">文档碎片管理器</param>
        /// <param name="html">要分析成碎片的原始 HTML 文本</param>
        public DomFragment(DomFragmentManager manager, string html)
            : this( manager )
        {
            var parser = manager.GetParser();

            parser.ParseToFragment(html, this);
        }
Exemple #3
0
        /// <summary>
        /// 创建 DomDocument 对象
        /// </summary>
        /// <param name="uri">文档的 URL</param>
        /// <param name="fragementParserProvider">文档碎片解析器提供程序,用于提供相似行为的文档碎片解析器</param>
        public DomDocument( Uri uri, IDomFragmentParserProvider fragementParserProvider )
        {
            if ( fragementParserProvider == null )
            throw new ArgumentNullException( "fragementParserProvider" );

              _uri = uri;
              _manager = new DomFragmentManager( this, fragementParserProvider );
              _modifier = new DomModifier();

              _modifier.HtmlDomChanged += OnDomChanged;
        }
Exemple #4
0
        /// <summary>
        /// 创建 DomDocument 对象
        /// </summary>
        /// <param name="uri">文档的 URL</param>
        /// <param name="fragementParserProvider">文档碎片解析器提供程序,用于提供相似行为的文档碎片解析器</param>
        public DomDocument(Uri uri, IDomFragmentParserProvider fragementParserProvider)
        {
            if (fragementParserProvider == null)
            {
                throw new ArgumentNullException("fragementParserProvider");
            }

            _uri      = uri;
            _manager  = new DomFragmentManager(this, fragementParserProvider);
            _modifier = new DomModifier();

            _modifier.HtmlDomChanged += OnDomChanged;
        }
Exemple #5
0
 /// <summary>
 /// 创建一个 DomFragment 实例
 /// </summary>
 /// <param name="manager">文档碎片管理器</param>
 public DomFragment( DomFragmentManager manager )
 {
     _manager = manager;
       _nodeCollection = new DomNodeCollection( this );
 }
Exemple #6
0
 /// <summary>
 /// 创建一个 DomFragment 实例
 /// </summary>
 /// <param name="manager">文档碎片管理器</param>
 public DomFragment(DomFragmentManager manager)
 {
     _manager        = manager;
     _nodeCollection = new DomNodeCollection(this);
 }