Ejemplo n.º 1
0
        public PageXmlDocument GetIndexXmlDocument()
        {
            //return new PageXmlDocument(this.FilePath,this.Id, this.PageType);
            PageXmlDocument doc = PageXmlDocument.CreateInstance(this.RelativeFilePath, this.Id, this.PageType, this);

            doc.Load();

            return(doc);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建一个PageXmlDocument对象。(type参数决定从哪个派生类创建)
        /// </summary>
        static public PageXmlDocument CreateInstance(string relativeFilePath, string pageId, PageType type, SimpleExIndexXmlElement sdsiteElement)
        {
            Debug.Assert(!string.IsNullOrEmpty(relativeFilePath));
            Debug.Assert(!string.IsNullOrEmpty(pageId));

            PageXmlDocument doc = null;

            switch (type)
            {
            case PageType.General:
                doc = new GeneralPageXmlDocument(relativeFilePath, sdsiteElement);
                break;

            case PageType.Product:
                doc = new ProductXmlDocument(relativeFilePath, sdsiteElement);
                break;

            case PageType.Project:
                doc = new ProjectXmlDocument(relativeFilePath, sdsiteElement);
                break;

            case PageType.InviteBidding:
                doc = new InviteBiddingXmlDocument(relativeFilePath, sdsiteElement);
                break;

            case PageType.Knowledge:
                doc = new KnowledgeXmlDocument(relativeFilePath, sdsiteElement);
                break;

            case PageType.Hr:
                doc = new HrXmlDocument(relativeFilePath, sdsiteElement);
                break;

            case PageType.Home:
                doc = new HomeXmlDocument(relativeFilePath, sdsiteElement);
                break;

            default:
                Debug.Assert(false, "开发期错误。未知的PageType:" + type);
                break;
            }

            return(doc);
        }
Ejemplo n.º 3
0
        //internal virtual void MarkXhtmlElement()
        //{
        //    this.MarkXhtmlElement(null);
        //}

        /// <summary>
        /// 根据当前节点的特性来设置该节点
        /// </summary>
        internal virtual void MarkXhtmlElement(PageXmlDocument pageDoc)
        {
            this.PageXmlDocument = pageDoc;
            this.TagCreator();

            #region if DEBUG, 辩别生成效果
#if DEBUG       //为了辩别生成效果,在Debug时节点加入相关的节点名字
            //string eleName = this.LocalName;
            //PropertyInfo pinfo = this.GetType().GetProperty("SnipPartType");
            //if (pinfo != null)
            //{
            //    eleName = eleName + "_" + pinfo.GetValue(this, null);
            //}
            //if (this._XhtmlElement != null && !(this._XhtmlElement is XhtmlText) && !(this._XhtmlElement is XhtmlCData) && !(this._XhtmlElement is XhtmlComment))
            //{
            //    this._XhtmlElement.SetAttribute("name", eleName);
            //}
#endif
            #endregion

            foreach (XmlNode node in this.ChildNodes)
            {
                if (node.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                if (node is ToHtmlXmlElement)
                {
                    if (node is SnipXmlElement)
                    {
                        SnipXmlElement snip = (SnipXmlElement)node;
                        if (!snip.HasSnip)///如果页面片节点里面并不含有页面片的话,节约效率,就不用再往下遍历
                        {
                            continue;
                        }
                    }
                    ToHtmlXmlElement htmlNode = (ToHtmlXmlElement)node;
                    htmlNode.PageXmlDocument    = this.PageXmlDocument;
                    htmlNode.ParentXhtmlElement = this.SetSubNode();
                    htmlNode.ToHtml();
                }
            }
            this._isAlreadyToHtml = true;
        }
Ejemplo n.º 4
0
 public PageDocumentProxy(PageXmlDocument document)
 {
     this._id             = document.Id;
     this._sdsiteDocument = document.OwnerSdsiteDocument;
 }