protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.showStatus == null && this.Page != null) { EcpContentPage ecpContentPage = this.Page as EcpContentPage; if (ecpContentPage != null && ecpContentPage.FeatureSet == FeatureSet.Options) { this.showStatusDefault = false; } } if (!string.IsNullOrEmpty(this.DataSourceID)) { WebServiceListSource webServiceListSource = this.FindControl(this.DataSourceID) as WebServiceListSource; if (webServiceListSource != null) { this.listSource = webServiceListSource; this.Commands.Add(new RefreshCommand()); } } this.toolbar.ApplyRolesFilter(); if (this.Commands.Count == 0 && this.Controls.Contains(this.toolbar)) { this.Controls.Remove(this.toolbar); } this.UpdateColumns(); if (this.Views.Count > 0) { ComponentBinding componentBinding = new ComponentBinding(this.viewFilterDropDown, "filterValue"); componentBinding.Name = "SelectedView"; this.listSource.FilterParameters.Add(componentBinding); } if (this.ShowSearchBar) { if (string.IsNullOrEmpty(this.LocalSearchViewModel)) { ComponentBinding componentBinding2 = new ComponentBinding(this.searchTextBox, "filterText"); componentBinding2.Name = "SearchText"; this.listSource.FilterParameters.Add(componentBinding2); } else { ComponentBinding componentBinding3 = new ComponentBinding(this.searchTextBox, "advancedSearch"); componentBinding3.Name = "SearchText"; this.listSource.FilterParameters.Add(componentBinding3); } } this.ClientSort |= this.SupportAsyncGetList; if (this.ShowHeader && !this.ClientSort) { ComponentBinding componentBinding4 = new ComponentBinding(this, "SortDirection"); componentBinding4.Name = "Direction"; this.listSource.SortParameters.Add(componentBinding4); ComponentBinding componentBinding5 = new ComponentBinding(this, "SortProperty"); componentBinding5.Name = "PropertyName"; this.listSource.SortParameters.Add(componentBinding5); } this.listSource.UpdateParameters(); }
protected override void OnLoad(EventArgs e) { try { WebServiceReference webServiceReference = new WebServiceReference("~/DDI/DDIService.svc?schema=VirtualDirectory&workflow=GetServerDropDown"); this.serverListResult = webServiceReference.GetList(null, null); if (this.serverListResult.Output != null && this.serverListResult.Output.Length > 0) { base.Views = new List <ListItem>(); JsonDictionary <object>[] output = this.serverListResult.Output; for (int i = 0; i < output.Length; i++) { Dictionary <string, object> dictionary = output[i]; base.Views.Add(new ListItem((string)dictionary["Fqdn"], (string)dictionary["Fqdn"])); } base.Views.Sort((ListItem item1, ListItem item2) => item1.Text.CompareTo(item2.Text)); } } catch (TargetInvocationException ex) { throw ex.InnerException; } finally { base.Views.Insert(0, new ListItem(Strings.AllServers, string.Empty)); } ListItem[] items = new ListItem[] { new ListItem(Strings.AllVDirTypes, "All"), new ListItem("Autodiscover", "Autodiscover"), new ListItem("EAS", "EAS"), new ListItem("ECP", "ECP"), new ListItem("EWS", "EWS"), new ListItem("OAB", "OAB"), new ListItem("OWA", "OWA"), new ListItem("PowerShell", "PowerShell") }; this.vDirDropDown = new FilterDropDown(); this.vDirDropDown.LabelText = Strings.SelectVDirTypeLabel; this.vDirDropDown.ID = "VDirTypeDropDown"; this.vDirDropDown.Items.AddRange(items); this.vDirDropDown.Width = Unit.Percentage(100.0); ComponentBinding componentBinding = new ComponentBinding(this.vDirDropDown, "filterValue"); componentBinding.Name = "SelectedVDirType"; WebServiceListSource webServiceListSource = (WebServiceListSource)this.FindControl("listSource"); webServiceListSource.FilterParameters.Add(componentBinding); this.vDirDropDown.Style.Add(HtmlTextWriterStyle.MarginTop, "30"); this.FindControl("ViewFilterDropDown").Parent.Controls.Add(this.vDirDropDown); base.OnLoad(e); }