Ejemplo n.º 1
0
        public HtmlString CoreDropDownList(CoreDropDownList dropDownList, string id)
        {
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            //IL_001c: Expected O, but got Unknown
            CoreDropDownListRenderer coreDropDownListRenderer = new CoreDropDownListRenderer(dropDownList);

            dropDownList.ID = id;
            return(new HtmlString(coreDropDownListRenderer.RenderHtml()));
        }
        private string GetStartupOptions()
        {
            StringBuilder                stringBuilder    = new StringBuilder();
            CoreDropDownList             model            = _model;
            DropDownListClientSideEvents clientSideEvents = _model.ClientSideEvents;

            stringBuilder.AppendFormat("id:'{0}'", model.ID);
            stringBuilder.AppendFormat(",width:{0}", model.Width.ToString());
            stringBuilder.AppendFormat(",height:{0}", model.Height.ToString());
            if (model.DropDownWidth.HasValue)
            {
                stringBuilder.AppendFormat(",dropDownWidth:{0}", model.DropDownWidth.ToString());
            }
            if (model.TabIndex != 0)
            {
                stringBuilder.AppendFormat(",tabIndex:{0}", model.TabIndex.ToString());
            }
            if (model.Items.Count > 0)
            {
                stringBuilder.AppendFormat(",items:{0}", JsonConvert.SerializeObject((object)model.SerializeItems(model.Items)));
            }
            if (!string.IsNullOrEmpty(model.ItemTemplateID))
            {
                stringBuilder.AppendFormat(",itemTemplateID:'{0}'", model.ItemTemplateID);
            }
            if (!string.IsNullOrEmpty(model.HeaderTemplateID))
            {
                stringBuilder.AppendFormat(",headerTemplateID:'{0}'", model.HeaderTemplateID);
            }
            if (!string.IsNullOrEmpty(model.FooterTemplateID))
            {
                stringBuilder.AppendFormat(",footerTemplateID:'{0}'", model.FooterTemplateID);
            }
            if (!string.IsNullOrEmpty(model.ToggleImageCssClass))
            {
                stringBuilder.AppendFormat(",toggleImageCssClass:'{0}'", model.ToggleImageCssClass);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.Show))
            {
                stringBuilder.AppendFormat(",onShow:{0}", clientSideEvents.Show);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.Hide))
            {
                stringBuilder.AppendFormat(",onHide:{0}", clientSideEvents.Hide);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.MouseOut))
            {
                stringBuilder.AppendFormat(",onMouseOut:{0}", clientSideEvents.MouseOut);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.MouseOver))
            {
                stringBuilder.AppendFormat(",onMouseOver:{0}", clientSideEvents.MouseOver);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.Select))
            {
                stringBuilder.AppendFormat(",onSelect:{0}", clientSideEvents.Select);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.Select))
            {
                stringBuilder.AppendFormat(",onInitialized:{0}", clientSideEvents.Initialized);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.Select))
            {
                stringBuilder.AppendFormat(",onKeyDown:{0}", clientSideEvents.KeyDown);
            }
            return(stringBuilder.ToString());
        }
 public CoreDropDownListRenderer(CoreDropDownList model)
 {
     _model = model;
 }