protected override void CreateChildControls() { base.CreateChildControls(); this.contentPanel = new Panel(); this.contentPanel.ID = "pickerContentPanel"; this.contentPanel.CssClass = "contentPanel"; ColumnHeader columnHeader = new ColumnHeader(); columnHeader.Name = "DisplayName"; columnHeader.Width = 100; this.listView = new ListView { ID = "pickerListView" }; this.listView.ShowSearchBar = false; this.listView.ShowTitle = false; this.listView.ShowHeader = false; this.listView.ShowStatus = false; this.listView.MultiSelect = true; this.listView.Height = Unit.Pixel(150); this.listView.Width = Unit.Pixel(200); this.listView.CssClass = "pickerListView"; this.listView.ServiceUrl = this.ServiceUrl; this.listView.Columns.Add(columnHeader); this.contentPanel.Controls.Add(this.listView); this.Controls.Add(this.contentPanel); }
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); }
protected override void CreateChildControls() { base.CreateChildControls(); this.comboScope = new WebServiceDropDown(); this.comboScope.ServiceUrl = this.serviceUrl; this.comboScope.ID = "comboScope"; this.comboScope.Width = new Unit(97.0, UnitType.Percentage); this.comboScope.Attributes["SetRoles"] = "Get-ManagementScope"; this.comboScope.Attributes["helpId"] = "EditRoleGroup_Scope"; this.lblMultiScope = new Label(); this.lblMultiScope.Text = Strings.MultipleScopeInRoleGroup; this.lblMultiScope.ID = "lblMultipleScopeScenario"; if (Util.IsDataCenter) { this.Controls.Add(this.comboScope); this.Controls.Add(this.lblMultiScope); return; } this.rbScope = new RadioButton(); this.rbScope.ID = "rbScope"; this.rbScope.Checked = true; this.rbScope.Attributes["helpId"] = "EditRoleGroup_Scope"; this.rbScope.GroupName = "EditRoleGroupScope"; this.rbOrganizationalUnit = new RadioButton(); this.rbOrganizationalUnit.ID = "rbOU"; this.rbOrganizationalUnit.CssClass = "scopeControlRadioCell"; this.rbOrganizationalUnit.Attributes["helpId"] = "EditRoleGroup_OU"; this.rbOrganizationalUnit.GroupName = "EditRoleGroupScope"; this.tbxOrganizationalUnit = new TextBox(); this.tbxOrganizationalUnit.ID = "tbxOU"; this.tbxOrganizationalUnit.Width = new Unit(95.0, UnitType.Percentage); this.tbxOrganizationalUnit.CssClass = "ouTextBoxStyle"; this.tbxOrganizationalUnit.Attributes["SetRoles"] = "Get-OrganizationalUnit"; this.tbxOrganizationalUnit.Attributes["helpId"] = "EditRoleGroup_OU"; this.lblOrganizationUnit = new Label(); this.lblOrganizationUnit.Text = Strings.OULabel; this.lblOrganizationUnit.ID = "tbxOU_label"; this.layoutTable = new HtmlTable(); this.layoutTable.ID = "ScopeTable"; this.layoutTable.Attributes.Add("class", "scopePickerTable"); HtmlTableRow htmlTableRow = new HtmlTableRow(); HtmlTableCell htmlTableCell = new HtmlTableCell(); HtmlTableCell htmlTableCell2 = new HtmlTableCell(); htmlTableCell2.Attributes.Add("class", "scopeControlComboCell"); htmlTableCell.Controls.Add(this.rbScope); htmlTableCell.Attributes.Add("class", "scopeControlRadioCell"); htmlTableCell2.Controls.Add(this.comboScope); htmlTableRow.Cells.Add(htmlTableCell); htmlTableRow.Cells.Add(htmlTableCell2); this.layoutTable.Rows.Add(htmlTableRow); HtmlTableRow htmlTableRow2 = new HtmlTableRow(); htmlTableRow2.Attributes.Add("class", "scopePickerEmptyRow"); this.layoutTable.Rows.Add(htmlTableRow2); HtmlTableRow htmlTableRow3 = new HtmlTableRow(); HtmlTableCell cell = new HtmlTableCell(); HtmlTableCell htmlTableCell3 = new HtmlTableCell(); htmlTableCell3.Controls.Add(this.lblOrganizationUnit); htmlTableRow3.Cells.Add(cell); htmlTableRow3.Cells.Add(htmlTableCell3); this.layoutTable.Rows.Add(htmlTableRow3); HtmlTableRow htmlTableRow4 = new HtmlTableRow(); HtmlTableCell htmlTableCell4 = new HtmlTableCell(); HtmlTableCell htmlTableCell5 = new HtmlTableCell(); htmlTableCell5.Attributes.Add("class", "scopeControlComboCell"); htmlTableCell4.Attributes.Add("class", "scopeControlRadioCell"); htmlTableCell4.Controls.Add(this.rbOrganizationalUnit); htmlTableCell5.Controls.Add(this.tbxOrganizationalUnit); htmlTableRow4.Cells.Add(htmlTableCell4); htmlTableRow4.Cells.Add(htmlTableCell5); this.layoutTable.Rows.Add(htmlTableRow4); this.Controls.Add(this.layoutTable); this.Controls.Add(this.lblMultiScope); }
public static bool UseDDIService(WebServiceReference service) { return(service != null && !string.IsNullOrEmpty(service.ServiceUrl) && service.ServiceUrl.IndexOf("DDIService.svc", StringComparison.OrdinalIgnoreCase) != -1); }