protected override void RenderChildren(HtmlTextWriter writer) { HyperLink hyperLink = new HyperLink(); hyperLink.NavigateUrl = "#"; hyperLink.CssClass = "ToolBarButtonLnk"; hyperLink.Attributes.Add("onclick", "javascript:return false;"); hyperLink.Attributes.Add("role", "button"); CommandSprite commandSprite = null; if (this.imageId != CommandSprite.SpriteId.NONE || !string.IsNullOrEmpty(this.Command.CustomSpriteCss)) { commandSprite = new CommandSprite(); commandSprite.CssClass = "ToolBarImage"; if (this.imageId != CommandSprite.SpriteId.NONE) { commandSprite.ImageId = this.ImageID; } else { CommandSprite commandSprite2 = commandSprite; commandSprite2.CssClass = commandSprite2.CssClass + " " + this.Command.CustomSpriteCss; } if (string.IsNullOrEmpty(this.Command.Text)) { if (string.IsNullOrEmpty(this.ImageAltText)) { ArgumentNullException ex = new ArgumentNullException("ImageAltText must be set if Command.Text is null/empty."); ex.Data["Name"] = this.Command.Name; ex.Data["Type"] = this.Command.GetType().FullName; ex.Data["ClientId"] = this.ClientID; throw ex; } commandSprite.AlternateText = this.ImageAltText; hyperLink.ToolTip = this.ImageAltText; } hyperLink.Controls.Add(commandSprite); } else if (!base.DesignMode && string.IsNullOrEmpty(this.Command.Text) && string.IsNullOrEmpty(this.command.CustomSpriteCss)) { throw new ArgumentNullException("Text or ImageId property must be set."); } if (!string.IsNullOrEmpty(this.Command.Text) || (commandSprite != null && !string.IsNullOrEmpty(commandSprite.AlternateText))) { EncodingLabel encodingLabel = new EncodingLabel(); if (!string.IsNullOrEmpty(this.Command.Text)) { encodingLabel.Text = this.Command.Text; encodingLabel.CssClass = "ToolBarButtonSpan"; } else { encodingLabel.Text = commandSprite.AlternateText; encodingLabel.CssClass = "ToolBarButtonImageAlter"; } hyperLink.Controls.Add(encodingLabel); } this.Controls.Add(hyperLink); base.RenderChildren(writer); }
protected override void CreateChildControls() { base.CreateChildControls(); TableCell tableCell = new TableCell(); tableCell.CssClass = "dateChooserYearColumn"; tableCell.Controls.Add(this.ddlYear); TableCell tableCell2 = new TableCell(); tableCell2.CssClass = "dateChooserMonthColumn"; tableCell2.Controls.Add(this.ddlMonth); TableCell tableCell3 = new TableCell(); tableCell3.CssClass = "dateChooserDayColumn"; tableCell3.Controls.Add(this.ddlDay); TableRow tableRow = new TableRow(); tableRow.Cells.Add(tableCell); tableRow.Cells.Add(tableCell2); tableRow.Cells.Add(tableCell3); Table table = new Table(); table.CellPadding = 0; table.CellSpacing = 0; table.Rows.Add(tableRow); this.Controls.Add(table); EncodingLabel child = Util.CreateHiddenForSRLabel("year", this.ddlYear.ID); EncodingLabel child2 = Util.CreateHiddenForSRLabel("month", this.ddlMonth.ID); EncodingLabel child3 = Util.CreateHiddenForSRLabel("day", this.ddlDay.ID); this.ddlYear.Parent.Controls.Add(child); this.ddlMonth.Parent.Controls.Add(child2); this.ddlDay.Parent.Controls.Add(child3); }
protected override void CreateChildControls() { Table table = new Table(); table.CellPadding = 0; table.CellSpacing = 0; table.CssClass = "pickerTextBoxContainer"; table.Attributes.Add("role", "presentation"); TableRow tableRow = new TableRow(); TableCell tableCell = new TableCell(); tableCell.CssClass = "pickerTextBoxTd"; this.pickerTextBox.CssClass = "pickerTextBox"; this.pickerTextBox.TabIndex = 0; this.pickerTextBox.ReadOnly = true; tableCell.Controls.Add(this.pickerTextBox); this.cancelButton.NavigateUrl = "#"; this.cancelButton.Attributes.Add("onclick", "javascript:return false;"); this.cancelImage.ImageId = CommandSprite.SpriteId.ClearDefault; this.cancelImage.AlternateText = Strings.ClearSelectionTooltip; this.cancelButton.ToolTip = Strings.ClearSelectionTooltip; this.cancelButton.Controls.Add(this.cancelImage); EncodingLabel encodingLabel = new EncodingLabel(); encodingLabel.Text = "×"; encodingLabel.CssClass = "pickerTextBoxImageAlter"; this.cancelButton.Controls.Add(encodingLabel); this.indCell = new TableCell(); this.indCell.ID = "indCell"; this.indCell.CssClass = (this.HideClearButton ? "hidden" : "pickerTextBoxIndicatorTd"); this.indCell.Controls.Add(this.cancelButton); tableRow.Cells.Add(tableCell); tableRow.Cells.Add(this.indCell); table.Rows.Add(tableRow); Table table2 = new Table(); table2.CellPadding = 0; table2.CellSpacing = 1; table2.CssClass = "singleSelect"; table2.Attributes.Add("role", "presentation"); TableRow tableRow2 = new TableRow(); TableCell tableCell2 = new TableCell(); tableCell2.Controls.Add(table); tableRow2.Cells.Add(tableCell2); this.browseButton.CssClass = "pickerBrowseButton" + (Util.IsIE() ? " pickerBrowseButton-IE" : string.Empty); TableCell tableCell3 = new TableCell(); tableCell3.Controls.Add(this.browseButton); tableRow2.Cells.Add(tableCell3); table2.Rows.Add(tableRow2); this.Controls.Add(table2); EncodingLabel child = Util.CreateHiddenForSRLabel(string.Empty, this.browseButton.ID); EncodingLabel child2 = Util.CreateHiddenForSRLabel(string.Empty, this.cancelButton.ID); this.browseButton.Controls.Add(child); this.cancelButton.Controls.Add(child2); }
protected override void CreateChildControls() { base.CreateChildControls(); string text = "filter or search"; if (!string.IsNullOrEmpty(this.WatermarkText)) { text = this.WatermarkText; } this.hiddenForSRLabel = Util.CreateHiddenForSRLabel(text, this.ID); this.Controls.Add(this.hiddenForSRLabel); this.imageButtonFilter = new HyperLink(); this.imageButtonFilter.NavigateUrl = "#"; this.imageButtonFilter.Attributes.Add("onclick", "javascript:return false;"); this.imageButtonFilter.ToolTip = this.SearchButtonToolTip; this.imageButtonFilter.ID = this.ID + "_SearchButton"; CommandSprite commandSprite = new CommandSprite(); if (this.SearchButtonImageId != null) { commandSprite.ImageId = this.SearchButtonImageId.Value; } else { commandSprite.ImageId = CommandSprite.SpriteId.SearchDefault; } commandSprite.ID = this.imageButtonFilter.ID + "_ImageSearchButton"; commandSprite.AlternateText = this.SearchButtonToolTip; this.imageButtonFilter.Controls.Add(commandSprite); EncodingLabel encodingLabel = new EncodingLabel(); encodingLabel.Text = RtlUtil.SearchDefaultMock; encodingLabel.ToolTip = this.SearchButtonToolTip; encodingLabel.CssClass = "filterIndicatorImageAlter"; this.imageButtonFilter.Controls.Add(encodingLabel); this.Controls.Add(this.imageButtonFilter); this.watermarkExtender = new TextBoxWatermarkExtender(); this.watermarkExtender.TargetControlID = this.UniqueID; this.watermarkExtender.WatermarkCssClass = "TextBoxWatermark"; this.watermarkExtender.WatermarkText = this.WatermarkText; this.Controls.Add(this.watermarkExtender); if (this.enableAutoSuggestion) { this.autoCompleteExtender = new EcpAutoCompleteExtender(); this.autoCompleteExtender.TargetControlID = this.UniqueID; WebServiceMethod webServiceMethod = new WebServiceMethod(); webServiceMethod.ServiceUrl = new WebServiceReference(string.Format("{0}&workflow={1}", this.suggestionServicePath, this.SuggestionServiceWorkFlow)); webServiceMethod.ID = this.autoCompleteExtender.ID + "WebServiceMethod"; webServiceMethod.Method = this.SuggestionServiceMethod; webServiceMethod.ParameterNames = (WebServiceParameterNames)Enum.Parse(typeof(WebServiceParameterNames), "GetList"); this.autoCompleteExtender.WebServiceMethod = webServiceMethod; this.autoCompleteExtender.AutoSuggestionPropertyNames = this.autoSuggestionPropertyNames; this.autoCompleteExtender.AutoSuggestionPropertyValues = this.autoSuggestionPropertyValues; this.Controls.Add(this.autoCompleteExtender); } }
protected SimpleEntryEditor() : base(HtmlTextWriterTag.Div) { base.Style.Add(HtmlTextWriterStyle.Display, "none"); this.Controls.Add(this.EditControl); EncodingLabel encodingLabel = new EncodingLabel(); encodingLabel.ID = "label"; encodingLabel.CssClass = "HiddenForScreenReader"; T t = this.EditControl; t.Controls.Add(encodingLabel); }
protected override void CreateChildControls() { base.CreateChildControls(); Table table = new Table(); TableRow tableRow = new TableRow(); TableCell tableCell = new TableCell(); Table table2 = new Table(); TableRow tableRow2 = new TableRow(); TableCell tableCell2 = new TableCell(); tableCell2.CssClass = "ddBoxTxtTd"; if (Util.IsIE()) { this.dateText.CssClass = "dateTextIE"; } tableCell2.Controls.Add(this.dateText); TableCell tableCell3 = new TableCell(); tableCell3.CssClass = "ddBoxImgTd"; tableCell3.Controls.Add(this.dropArrow); tableRow2.Cells.Add(tableCell2); tableRow2.Cells.Add(tableCell3); table2.Rows.Add(tableRow2); table2.CssClass = "ddBoxTbl"; this.dateComboBox.Controls.Add(table2); this.calendar.CssClass = "dpDd"; this.calendar.Style[HtmlTextWriterStyle.Display] = "none"; this.dateComboBox.CssClass = "datePicker dropDownBox"; this.datePicker.Controls.Add(this.dateComboBox); this.datePicker.Controls.Add(this.calendar); tableCell.Controls.Add(this.datePicker); tableRow.Cells.Add(tableCell); TableCell tableCell4 = new TableCell(); this.timePicker.CssClass = "timePicker"; if (!this.HasTimePicker) { this.timePicker.Enabled = false; tableCell4.Style[HtmlTextWriterStyle.Display] = "none"; } EncodingLabel child = Util.CreateHiddenForSRLabel(string.Empty, this.timePicker.ID); tableCell4.Controls.Add(child); tableCell4.Controls.Add(this.timePicker); tableRow.Cells.Add(tableCell4); table.Rows.Add(tableRow); table.CellSpacing = 0; table.CellPadding = 5; this.Controls.Add(table); this.CssClass = "dateTimePicker"; }
protected override void CreateChildControls() { base.CreateChildControls(); Table table = new Table(); table.Width = Unit.Percentage(100.0); TableRow tableRow = new TableRow(); TableCell tableCell = new TableCell(); tableCell.CssClass = "InputCell"; this.watermarkExtender.TargetControlID = this.textBox.ClientID; this.watermarkExtender.WatermarkCssClass = "TextBoxWatermark"; this.watermarkExtender.WatermarkText = (this.WatermarkText.IsNullOrBlank() ? string.Empty : this.WatermarkText); this.textBox.MaxLength = this.MaxLength; tableCell.Controls.Add(this.textBox); EncodingLabel child = Util.CreateHiddenForSRLabel(this.watermarkExtender.WatermarkText, this.textBox.ClientID); tableCell.Controls.Add(child); TableCell tableCell2 = new TableCell(); tableCell2.CssClass = "ButtonCell"; ToolBarButton toolBarButton = new ToolBarButton(new Command { ImageId = CommandSprite.SpriteId.MetroAdd, ImageAltText = Strings.InlineEditorAddAlternateText }); toolBarButton.BorderWidth = Unit.Pixel(0); ToolBarButton toolBarButton2 = toolBarButton; toolBarButton2.CssClass += " EnabledToolBarItem"; toolBarButton.ID = "addBtn"; tableCell2.Controls.Add(toolBarButton); tableCell2.ID = "imageCell"; tableRow.Cells.Add(tableCell); tableRow.Cells.Add(tableCell2); table.Rows.Add(tableRow); this.Controls.Add(table); this.Controls.Add(this.watermarkExtender); }
protected override void CreateChildControls() { base.CreateChildControls(); Table table = new Table(); TableRow tableRow = new TableRow(); Command defaultCommand = this.Command.GetDefaultCommand(); int num = (defaultCommand == null) ? 1 : 2; bool flag = this.Command.Commands.Count >= num && this.Command.Commands.ContainsVisibleCommands(); TableCell tableCell = new TableCell(); bool flag2; if (defaultCommand == null) { flag2 = flag; } else { flag2 = (defaultCommand.SelectionMode == SelectionMode.SelectionIndependent); } tableCell.CssClass = (flag2 ? "EnabledButtonPart" : "DisabledButtonPart"); this.toolBarButton = new ToolBarButton(this.Command); this.toolBarButton.CssClass = "SplitButtonButtonPart"; tableCell.Controls.Add(this.toolBarButton); tableRow.Cells.Add(tableCell); if (!this.HideArrow) { TableCell tableCell2 = new TableCell(); tableCell2.HorizontalAlign = HorizontalAlign.Center; CommandSprite commandSprite = new CommandSprite(); commandSprite.AlternateText = Strings.More; if (!flag) { tableCell2.CssClass = "SplitButtonArrow DisabledSplitArrow"; commandSprite.ImageId = CommandSprite.SpriteId.DisabledArrow; } else { tableCell2.CssClass = "SplitButtonArrow EnabledSplitArrow"; commandSprite.ImageId = CommandSprite.SpriteId.EnabledArrow; } CommandSprite commandSprite2 = commandSprite; commandSprite2.CssClass += " SplitButtonImage"; HyperLink hyperLink = new HyperLink(); hyperLink.NavigateUrl = "#"; hyperLink.CssClass = "ToolBarButtonLnk"; hyperLink.Attributes.Add("role", "button"); hyperLink.Attributes.Add("aria-haspopup", "true"); hyperLink.ToolTip = Strings.More; hyperLink.Attributes.Add("onclick", "javascript:return false;"); hyperLink.Controls.Add(commandSprite); EncodingLabel encodingLabel = new EncodingLabel(); encodingLabel.Text = "▼"; encodingLabel.CssClass = "SplitButtonImageAlter"; hyperLink.Controls.Add(encodingLabel); tableCell2.Controls.Add(hyperLink); tableRow.Cells.Add(tableCell2); } table.Rows.Add(tableRow); table.Attributes.Add("role", "presentation"); this.Controls.Add(table); this.Controls.Add(this.contextMenu); }