예제 #1
0
        /// <summary>
        /// 设置子元素
        /// </summary>
        protected override void SetChildElements()
        {
            TitlePane control = (TitlePane)this.ControlHost.Content;

            this.HtmlWriter.AddAttribute("dojoType", "Controls/TitlePane");
            if (!IsPreview && !string.IsNullOrEmpty(this.ControlHost.Name))
            {
                this.HtmlWriter.AddAttribute("id", this.ControlHost.Name);
                this.HtmlWriter.AddAttribute("name", this.ControlHost.Name);
            }
            this.HtmlWriter.AddAttribute("toggleable", control.CanExpand.ToString().ToLower());
            this.HtmlWriter.AddAttribute("open", control.IsExpanded.ToString().ToLower());
            this.HtmlWriter.AddAttribute("duration", control.Duration.ToString());
            this.HtmlWriter.AddAttribute("title", this.ControlHost.Title);

            StringBuilder sbProps       = new StringBuilder();
            StringBuilder returnContent = new StringBuilder();
            string        props         = control.BuildControlProps(this.ScreenDefinition, this.IsPreview, this.PermissionData, returnContent);

            if (!string.IsNullOrEmpty(props))
            {
                sbProps.AppendFormat("{0},", props);
            }
            if (sbProps.ToString().Length > 0)
            {
                this.HtmlWriter.AddAttribute("data-dojo-props", sbProps.ToString().Substring(0, sbProps.ToString().Length - 1), false);
            }

            this.HtmlWriter.RenderBeginTag(this.TagName);
            //子元素
            foreach (var child in this.ControlHost.Children)
            {
                var builder = child.GetBuilder(this.IsPreview, this.ScreenDefinition, this.Compile, this.ProjectDocument, this.PermissionData, this.HtmlWriter);
                builder.Parent = this;
                builder.Build();
            }
            this.HtmlWriter.RenderEndTag();
        }
예제 #2
0
        /// <summary>
        /// 设置属性
        /// </summary>
        protected override void SetAttributes()
        {
            TitlePane control = (TitlePane)this.ControlHost.Content;

            base.SetAttributes();
        }