/// <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> /// 创建 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; }