Esempio n. 1
0
        public IFreeElement CreateElement(string name)
        {
            var fragment = _fragmentManager.CreateFragment();

            fragment.AddElement(name);
            return(new FreeElement(fragment, this));
        }
Esempio n. 2
0
        /// <summary>
        /// 创建指定节点的副本
        /// </summary>
        /// <param name="manager">HTML 碎片管理器,用来创建碎片</param>
        /// <param name="node">要创建副本的节点</param>
        /// <returns>节点的游离副本( HTML 碎片形式)</returns>
        public static IHtmlFragment MakeCopy(this IHtmlFragmentManager manager, IHtmlNode node)
        {
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }

            if (node == null)
            {
                throw new ArgumentNullException("node");
            }


            var fragment = manager.CreateFragment();

            fragment.AddCopy(node);

            return(fragment);
        }