Example #1
0
 /// <summary>
 /// .sdtmplt文档line元素(线段)
 /// </summary>
 /// <param name="doc"></param>
 public BorderLineXmlElement(TmpltXmlDocument doc)
     : base("borderLine", doc)
 {
 }
Example #2
0
        /// <summary>
        /// 根据当前节点的特性来设置该节点
        /// </summary>
        protected virtual void MarkXhtmlElement(PageSection pageSection)
        {
            switch (pageSection)
            {
            case PageSection.MainPage:
            {
                _XhtmlElement = new XhtmlSection();
                string       tmpltFullFile = this.ToHtmlHelper.TmpltRelativeUrl;
                XhtmlElement tag           = _XhtmlElement.CreateXhtmlCommentShtml
                                                 (tmpltFullFile + this.SdsiteElement.TmpltId + Utility.Const.ShtmlFileExt);
                _XhtmlElement.AppendChild(tag);
                this._isAlreadyToMainPageHtml = true;
                break;
            }

            case PageSection.Head:
            {
                _HeadXhtmlElement = new XhtmlSection();

                #region Title

                XhtmlTagElement title = _HeadXhtmlElement.CreateXhtmlTitle();
                title.InnerText = this.Title;
                _HeadXhtmlElement.AppendChild(title);

                #endregion

                #region keywords

                XhtmlAtts.Name    name;
                StringBuilder     sb;
                XhtmlAtts.Content content;

                if (!(this.PageKeywords == null))
                {
                    name = new XhtmlAtts.Name("keywords");
                    sb   = new StringBuilder();
                    foreach (string str in this.PageKeywords)
                    {
                        sb.Append(str).Append(',');
                    }
                    content = new XhtmlAtts.Content(sb.ToString().TrimEnd(','));
                    XhtmlTagElement keyword = _HeadXhtmlElement.CreateXhtmlMeta(name, content);
                    _HeadXhtmlElement.AppendChild(keyword);
                }

                #endregion

                #region description

                name    = new XhtmlAtts.Name("description");
                content = new XhtmlAtts.Content(this.PageSummary);
                XhtmlTagElement description = _HeadXhtmlElement.CreateXhtmlMeta(name, content);
                _HeadXhtmlElement.AppendChild(description);

                #endregion

                this._isAlreadyToHeadHtml = true;
                break;
            }

            case PageSection.Content:
            {
                SdsiteXmlDocument doc = (SdsiteXmlDocument)this.SdsiteElement.OwnerAnyDocument;

                string           tmpltId = this.SdsiteElement.TmpltId;
                TmpltXmlDocument tmplt   = doc.GetTmpltDocumentById(this.SdsiteElement.TmpltId);
                XhtmlSection     ele     = (XhtmlSection)tmplt.GetContentSnipEle().XhtmlElement;
                if (ele == null)
                {
                    SnipXmlElement snip = tmplt.GetContentSnipEle();
                    snip.MarkXhtmlElement(this);
                    ele = (XhtmlSection)tmplt.GetContentSnipEle().XhtmlElement;
                }
                _ContentXhtmlElement = ele;

                this._isAlreadyToContentHtml = true;
                break;
            }

            case PageSection.None:
            default:
                break;
            }
        }