// Token: 0x06001475 RID: 5237 RVA: 0x0007CF54 File Offset: 0x0007B154 private string GetExtraWatsonData() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("OWA Version: "); stringBuilder.Append(Globals.ApplicationVersion); stringBuilder.AppendLine(); if (this.listView is GroupByList2) { GroupByList2 groupByList = (GroupByList2)this.listView; stringBuilder.Append(string.Format("GroupByList: SortColumn: {0}, SortOrder: {1}", groupByList.GroupByColumn.Id, groupByList.SortOrder)); } else { ItemList2 itemList = (ItemList2)this.ItemList; stringBuilder.Append(string.Format("NOT GroupByList: SortColumn: {0}, SortOrder: {1}", itemList.SortedColumn.Id, itemList.SortOrder)); } stringBuilder.AppendLine(); if (this.userContext != null && !Globals.DisableBreadcrumbs) { stringBuilder.AppendLine(); stringBuilder.AppendLine(); stringBuilder.AppendLine(this.userContext.DumpBreadcrumbs()); } return(stringBuilder.ToString()); }
public ComboBoxViewModel() { for (int i = 0; i < 10; i++) { ItemList.Add(new MyData(i.ToString())); ItemList2.Add(i.ToString()); } Button1Click = new DelegateCommand(_Button1Click, CanButton1Click); }
public override void Process(TagHelperContext context, TagHelperOutput output) { (_htmlHelper as IViewContextAware).Contextualize(ViewContext); var prefix = ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix; var htmlId = prefix.IsEmpty() ? ModelItem.Metadata.PropertyName : _htmlHelper.IdForModel() + "_" + ModelItem.Metadata.PropertyName; var htmlName = prefix.IsEmpty() ? ModelItem.Metadata.PropertyName : prefix + "." + ModelItem.Metadata.PropertyName; output.TagName = "div"; output.TagMode = TagMode.StartTagAndEndTag; output.Attributes.Add("class", "input-group-btn"); if (ItemList == null && ItemList2 == null) { var comboDataInfo = GetComboBoxDataSource(ModelItem.ModelExplorer); ItemList = comboDataInfo.ListItems; } var selectedText = ""; var selectedValue = 0; if (ModelItem.Model != null) { if (ModelItem.Model is int) { selectedValue = int.Parse(ModelItem.Model.ToString()); } else { var ti = (int)ModelItem.Model; selectedValue = ti; } } if (ItemList != null) { var it = ItemList.Where(d => d.Value == selectedValue.ToString()).FirstOrDefault(); if (it == null) { it = ItemList.FirstOrDefault(); } if (it != null) { selectedValue = int.Parse(it.Value); selectedText = it.Text; } } else if (ItemList2 != null) { var it = ItemList2.Where(d => d.Value == selectedValue.ToString()).FirstOrDefault(); if (it == null) { it = ItemList2.FirstOrDefault(); } if (it != null) { selectedValue = int.Parse(it.Value); selectedText = it.Text; } } var sbOptions = new StringBuilder(); sbOptions.AppendLine($@" <button type=""button"" class=""btn btn-outline-secondary btn-sm dropdown-toggle"" data-toggle=""dropdown""> <span id=""lbl{htmlId}"">{selectedText}</span> <span class=""caret""></span> </button> <div class=""dropdown-menu""> "); if (ItemList != null) { foreach (var item in ItemList) { sbOptions.AppendLine($@"<a class=""dropdown-item"" href=""javascript:SelectComboGroup('{item.Text}', {item.Value}, '{htmlId}')"">{item.Text}</a>"); } } else if (ItemList2 != null) { foreach (var item in ItemList2) { sbOptions.AppendLine($@"<a class=""dropdown-item"" href=""javascript:SelectComboGroup('{item.Text}', {item.Value}, '{htmlId}')"">{item.Text}</a>"); } } sbOptions.AppendLine($@"</div> <input type=""hidden"" id=""{htmlId}"" name=""{htmlName}"" value=""{selectedValue}"" />"); output.Content.SetHtmlContent(sbOptions.ToString()); }