/// <summary> /// 从指定 HTML 创建一个 DomFragment 实例 /// </summary> /// <param name="manager">文档碎片管理器</param> /// <param name="html">要分析成碎片的原始 HTML 文本</param> public DomFragment(DomFragmentManager manager, string html) : this( manager ) { var parser = new FragmentParser(); parser.ProcessFragment(html, this); }
/// <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); }
/// <summary> /// 创建 DomDocument 对象 /// </summary> /// <param name="uri">文档的 URL</param> public DomDocument(Uri uri) { _uri = uri; _manager = new DomFragmentManager(this); _modifier = new DomModifier(); _modifier.HtmlDomChanged += OnDomChanged; }
/// <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 ); }
/// <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; }
/// <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; }
/// <summary> /// 创建一个 DomFragment 实例 /// </summary> /// <param name="manager">文档碎片管理器</param> public DomFragment(DomFragmentManager manager) { _manager = manager; _nodeCollection = new DomNodeCollection(this); }
/// <summary> /// 创建一个 DomFragment 实例 /// </summary> /// <param name="manager">文档碎片管理器</param> public DomFragment( DomFragmentManager manager ) { _manager = manager; _nodeCollection = new DomNodeCollection( this ); }