/// <summary>
        /// 构造 DomFragmentManager 对象
        /// </summary>
        /// <param name="document">FragmentManager 对象所属的文档</param>
        public DomFragmentManager(DomDocument document)
        {
            lock (document.SyncRoot)
            {
                if (document.FragmentManager != null)
                {
                    throw new InvalidOperationException();
                }

                _document = document;

                _fragments = new SynchronizedCollection <DomFragment>(SyncRoot);
            }
        }
Example #2
0
    /// <summary>
    /// 构造 DomFragmentManager 对象
    /// </summary>
    /// <param name="document">FragmentManager 对象所属的文档</param>
    /// <param name="parserProvider">文档碎片解析器提供程序</param>
    public DomFragmentManager( DomDocument document, IDomFragmentParserProvider parserProvider )
    {

      if ( document == null )
        throw new ArgumentNullException( "document" );

      if ( parserProvider == null )
        throw new ArgumentNullException( "parserProvider" );


      lock ( document.SyncRoot )
      {
        if ( document.FragmentManager != null )
          throw new InvalidOperationException();

        _document = document;

        _fragments = new SynchronizedCollection<DomFragment>( SyncRoot );
        _parserProvider = parserProvider;
      }
    }
Example #3
0
 /// <summary>
 /// 获取文档片段解析器
 /// </summary>
 /// <param name="document">要解析文档片段的文档</param>
 /// <returns></returns>
 public virtual IDomFragmentParser GetFragmentParser( DomDocument document )
 {
   return this;
 }
Example #4
0
 /// <summary>
 /// 获取文档片段解析器
 /// </summary>
 /// <param name="document">要解析文档片段的文档</param>
 /// <returns></returns>
 public virtual IDomFragmentParser GetFragmentParser(DomDocument document)
 {
     return(this);
 }