示例#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 = new FragmentParser();

            parser.ProcessFragment(html, this);
        }
示例#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);
        }
示例#3
0
        /// <summary>
        /// 创建 DomDocument 对象
        /// </summary>
        /// <param name="uri">文档的 URL</param>
        public DomDocument(Uri uri)
        {
            _uri      = uri;
            _manager  = new DomFragmentManager(this);
            _modifier = new DomModifier();

            _modifier.HtmlDomChanged += OnDomChanged;
        }
示例#4
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 );

    }
示例#5
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;
    }
示例#6
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;
        }
示例#7
0
 /// <summary>
 /// 创建一个 DomFragment 实例
 /// </summary>
 /// <param name="manager">文档碎片管理器</param>
 public DomFragment(DomFragmentManager manager)
 {
     _manager        = manager;
     _nodeCollection = new DomNodeCollection(this);
 }
示例#8
0
 /// <summary>
 /// 创建一个 DomFragment 实例
 /// </summary>
 /// <param name="manager">文档碎片管理器</param>
 public DomFragment( DomFragmentManager manager )
 {
   _manager = manager;
   _nodeCollection = new DomNodeCollection( this );
 }