Example #1
0
        /// <summary>
        /// 设置属性
        /// </summary>
        protected override void SetAttributes()
        {
            TabControl control = this.ControlHost.Content as TabControl;

            this.HtmlWriter.AddAttribute("dojoType", "Controls/TabContainer");
            if (!IsPreview && !string.IsNullOrEmpty(this.ControlHost.Name))
            {
                this.HtmlWriter.AddAttribute("id", this.ControlHost.Name);
                this.HtmlWriter.AddAttribute("name", this.ControlHost.Name);
            }
            if (control.ExistProperty("Position"))
            {
                this.HtmlWriter.AddAttribute("tabPosition", control.Position.ToString().ToLower());
            }
            if (control.ExistProperty("IsNested") && control.IsNested)
            {
                this.HtmlWriter.AddAttribute("nested", "true");
            }
            this.HtmlWriter.AddAttribute("tabStrip", "true");

            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);
            }

            base.SetAttributes();
        }