Example #1
0
        /// <summary>
        /// 设置属性
        /// </summary>
        protected override void SetAttributes()
        {
            if (!this.IsPreview)
            {
                RadioButtonList control = this.ControlHost.Content as RadioButtonList;
                this.HtmlWriter.AddAttribute("dojoType", "Controls/RadioButtonList");
                if (!IsPreview && !string.IsNullOrEmpty(this.ControlHost.Name))
                {
                    this.HtmlWriter.AddAttribute("id", this.ControlHost.Name);
                    this.HtmlWriter.AddAttribute("name", this.ControlHost.Name);
                }
                if (!string.IsNullOrEmpty(control.ToolTip) && this.ProjectDocument != null)
                {
                    this.HtmlWriter.AddAttribute("tooltip-name", this.ProjectDocument.Name + "_" + control.ToolTip);
                }


                string stores = GetStore();
                if (!string.IsNullOrEmpty(stores))
                {
                    this.HtmlWriter.AddAttribute("store", stores, false);
                }

                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);
                }
                sbProps.AppendFormat("orientation:'{0}',", control.Orientation.ToString().ToLower());
                if (sbProps.ToString().Length > 0)
                {
                    this.HtmlWriter.AddAttribute("data-dojo-props", sbProps.ToString().Substring(0, sbProps.ToString().Length - 1), false);
                }
            }

            base.SetAttributes();
        }