当前位置: 首页>>代码示例>>C#>>正文


C# Label.ApplyStyle方法代码示例

本文整理汇总了C#中System.Web.UI.WebControls.Label.ApplyStyle方法的典型用法代码示例。如果您正苦于以下问题:C# Label.ApplyStyle方法的具体用法?C# Label.ApplyStyle怎么用?C# Label.ApplyStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.WebControls.Label的用法示例。


在下文中一共展示了Label.ApplyStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderExistingConnection

        private void RenderExistingConnection(HtmlTextWriter writer,
                                              string connectionPointName,
                                              string partTitle,
                                              string disconnectEventArg,
                                              string editEventArg,
                                              bool consumer,
                                              bool isActive) {

            Label label = new Label();
            label.Page = Page;
            label.ApplyStyle(LabelStyle);

            writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);

            writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            writer.RenderBeginTag(HtmlTextWriterTag.Table);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            label.Text = (consumer ? SendText : GetText);
            label.RenderControl(writer);

            writer.RenderEndTag(); // TD
            LabelStyle.AddAttributesToRender(writer, this);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            writer.WriteEncodedText(connectionPointName);

            writer.RenderEndTag(); // TD
            writer.RenderEndTag(); // TR
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            label.Text = (consumer ? SendToText : GetFromText);
            label.RenderControl(writer);

            writer.RenderEndTag(); // TD
            LabelStyle.AddAttributesToRender(writer, this);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            writer.WriteEncodedText(partTitle);

            writer.RenderEndTag(); // TD
            writer.RenderEndTag(); // TR
            writer.RenderEndTag(); // TABLE

            WebPartVerb disconnectVerb = DisconnectVerb;
            disconnectVerb.EventArgument = disconnectEventArg;
            RenderVerb(writer, disconnectVerb);
            if (VerbButtonType == ButtonType.Link) {
                writer.Write(" ");
            }

            if (isActive) {
                WebPartVerb configureVerb = ConfigureVerb;
                if (editEventArg == null) {
                    configureVerb.Enabled = false;
                }
                else {
                    configureVerb.Enabled = true;
                    configureVerb.EventArgument = editEventArg;
                }
                RenderVerb(writer, configureVerb);
            }
            else {
                writer.WriteBreak();
                label.ApplyStyle(ErrorStyle);
                label.Text = ExistingConnectionErrorMessage;
                label.RenderControl(writer);
            }

            writer.RenderEndTag(); // FIELDSET
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:73,代码来源:ConnectionsZone.cs

示例2: RenderConnectToProvidersDropDowns

        private void RenderConnectToProvidersDropDowns(HtmlTextWriter writer) {
            WebPart webPartToConnect = WebPartToConnect;

            if (webPartToConnect != null) {
                ConsumerConnectionPointCollection consumers =
                    WebPartManager.GetEnabledConsumerConnectionPoints(webPartToConnect);
                bool first = true;
                Label label = new Label();
                label.Page = Page;
                label.AssociatedControlInControlTree = false;
                foreach (ConsumerConnectionPoint consumer in consumers) {
                    DropDownList list = (DropDownList)_connectDropDownLists[consumer];
                    if ((list == null) || !list.Enabled) {
                        continue;
                    }

                    if (first) {
                        string connectToProviderTitle = ConnectToProviderTitle;
                        if (!String.IsNullOrEmpty(connectToProviderTitle)) {
                            label.Text = connectToProviderTitle;
                            label.ApplyStyle(LabelStyle);
                            label.AssociatedControlID = String.Empty;
                            label.RenderControl(writer);
                            writer.WriteBreak();
                        }

                        string connectToProviderInstructionText = ConnectToProviderInstructionText;
                        if (!String.IsNullOrEmpty(connectToProviderInstructionText)) {
                            writer.WriteBreak();
                            label.Text = connectToProviderInstructionText;
                            label.ApplyStyle(InstructionTextStyle);
                            label.AssociatedControlID = String.Empty;
                            label.RenderControl(writer);
                            writer.WriteBreak();
                        }

                        first = false;
                    }

                    writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);

                    writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
                    writer.RenderBeginTag(HtmlTextWriterTag.Table);
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);

                    label.ApplyStyle(LabelStyle);
                    label.Text = GetText;
                    label.AssociatedControlID = String.Empty;
                    label.RenderControl(writer);

                    writer.RenderEndTag(); // TD

                    LabelStyle.AddAttributesToRender(writer, this);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);

                    writer.WriteEncodedText(consumer.DisplayName);

                    writer.RenderEndTag(); // TD
                    writer.RenderEndTag(); // TR
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);

                    label.Text = GetFromText;
                    label.AssociatedControlID = list.ClientID;
                    label.RenderControl(writer);

                    writer.RenderEndTag(); // TD
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);

                    list.ApplyStyle(EditUIStyle);
                    list.RenderControl(writer);

                    writer.RenderEndTag(); // TD
                    writer.RenderEndTag(); // TR
                    writer.RenderEndTag(); // TABLE

                    WebPartVerb connectVerb = ConnectVerb;
                    connectVerb.EventArgument = String.Join(ID_SEPARATOR.ToString(CultureInfo.InvariantCulture),
                        new string[] { connectEventArgument, consumerEventArgument, consumer.ID });
                    RenderVerb(writer, connectVerb);

                    writer.RenderEndTag(); // FIELDSET
                }
                writer.AddStyleAttribute(HtmlTextWriterStyle.TextAlign, "right");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                WebPartVerb cancelVerb = CancelVerb;
                cancelVerb.EventArgument = cancelEventArgument;
                RenderVerb(writer, cancelVerb);
                writer.RenderEndTag();
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:92,代码来源:ConnectionsZone.cs

示例3: RenderExistingConnections

 private void RenderExistingConnections(HtmlTextWriter writer) {
     WebPartManager manager = WebPartManager;
     bool headerRendered = false;
     bool consumersHeaderRendered = false;
     bool providersHeaderRendered = false;
     if (manager != null) {
         WebPart webPartToConnect = WebPartToConnect;
         // First, display connections for which we are providers (connections to consumers)
         WebPartConnectionCollection connections = manager.Connections;
         foreach (WebPartConnection connection in connections) {
             if (connection.Provider == webPartToConnect) {
                 if (!headerRendered) {
                     RenderInstructionTitle(writer);
                     RenderInstructionText(writer);
                     headerRendered = true;
                 }
                 if (!consumersHeaderRendered) {
                     writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);
                     LabelStyle.AddAttributesToRender(writer, this);
                     writer.RenderBeginTag(HtmlTextWriterTag.Legend);
                     writer.Write(ConsumersTitle);
                     writer.RenderEndTag(); // Legend
                     string instructionText = ConsumersInstructionText;
                     if (!String.IsNullOrEmpty(instructionText)) {
                         writer.WriteBreak();
                         Label label = new Label();
                         label.Text = instructionText;
                         label.Page = Page;
                         label.ApplyStyle(InstructionTextStyle);
                         label.RenderControl(writer);
                         writer.WriteBreak();
                     }
                     consumersHeaderRendered = true;
                 }
                 RenderExistingConsumerConnection(writer, connection);
             }
         }
         if (consumersHeaderRendered) {
             writer.RenderEndTag(); // Fieldset
         }
         // Then, display connections for which we are consumers (connections to providers)
         foreach (WebPartConnection connection in connections) {
             if (connection.Consumer == webPartToConnect) {
                 if (!headerRendered) {
                     RenderInstructionTitle(writer);
                     RenderInstructionText(writer);
                     headerRendered = true;
                 }
                 if (!providersHeaderRendered) {
                     writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);
                     LabelStyle.AddAttributesToRender(writer, this);
                     writer.RenderBeginTag(HtmlTextWriterTag.Legend);
                     writer.Write(ProvidersTitle);
                     writer.RenderEndTag(); // Legend
                     string instructionText = ProvidersInstructionText;
                     if (!String.IsNullOrEmpty(instructionText)) {
                         writer.WriteBreak();
                         Label label = new Label();
                         label.Text = instructionText;
                         label.Page = Page;
                         label.ApplyStyle(InstructionTextStyle);
                         label.RenderControl(writer);
                         writer.WriteBreak();
                     }
                     providersHeaderRendered = true;
                 }
                 RenderExistingProviderConnection(writer, connection);
             }
         }
     }
     if (providersHeaderRendered) {
         writer.RenderEndTag(); // Fieldset
     }
     if (headerRendered) {
         writer.WriteBreak();
     }
     else {
         RenderNoExistingConnection(writer);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:80,代码来源:ConnectionsZone.cs

示例4: RenderTransformerConfigurationHeader

 private void RenderTransformerConfigurationHeader(HtmlTextWriter writer)
 {
     if (this.EnsurePendingData())
     {
         string text = null;
         string displayTitle = null;
         bool flag = this._pendingConsumer == this.WebPartToConnect;
         if ((this._pendingConnectionType == ConnectionType.Consumer) && flag)
         {
             displayTitle = this._pendingProvider.DisplayTitle;
             text = this._pendingConsumerConnectionPoint.DisplayName;
         }
         else
         {
             displayTitle = this._pendingConsumer.DisplayTitle;
             text = this._pendingProviderConnectionPoint.DisplayName;
         }
         Label label = new Label {
             Page = this.Page
         };
         label.ApplyStyle(base.LabelStyle);
         label.Text = flag ? this.ConnectToProviderTitle : this.ConnectToConsumerTitle;
         label.RenderControl(writer);
         writer.WriteBreak();
         writer.WriteBreak();
         label.ApplyStyle(base.InstructionTextStyle);
         label.Text = flag ? this.ConnectToProviderInstructionText : this.ConnectToConsumerInstructionText;
         label.RenderControl(writer);
         writer.WriteBreak();
         writer.WriteBreak();
         writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
         writer.RenderBeginTag(HtmlTextWriterTag.Table);
         writer.RenderBeginTag(HtmlTextWriterTag.Tr);
         writer.RenderBeginTag(HtmlTextWriterTag.Td);
         label.ApplyStyle(base.LabelStyle);
         label.Text = flag ? this.GetText : this.SendText;
         label.RenderControl(writer);
         writer.RenderEndTag();
         base.LabelStyle.AddAttributesToRender(writer, this);
         writer.RenderBeginTag(HtmlTextWriterTag.Td);
         writer.WriteEncodedText(text);
         writer.RenderEndTag();
         writer.RenderEndTag();
         writer.RenderBeginTag(HtmlTextWriterTag.Tr);
         writer.RenderBeginTag(HtmlTextWriterTag.Td);
         label.Text = flag ? this.GetFromText : this.SendToText;
         label.RenderControl(writer);
         writer.RenderEndTag();
         base.LabelStyle.AddAttributesToRender(writer, this);
         writer.RenderBeginTag(HtmlTextWriterTag.Td);
         writer.WriteEncodedText(displayTitle);
         writer.RenderEndTag();
         writer.RenderEndTag();
         writer.RenderEndTag();
         writer.WriteBreak();
         writer.RenderBeginTag(HtmlTextWriterTag.Hr);
         writer.RenderEndTag();
         writer.WriteBreak();
         label.ApplyStyle(base.LabelStyle);
         label.Text = this.ConfigureConnectionTitle;
         label.RenderControl(writer);
         writer.WriteBreak();
         writer.WriteBreak();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:65,代码来源:ConnectionsZone.cs

示例5: RenderConnectToProvidersDropDowns

 private void RenderConnectToProvidersDropDowns(HtmlTextWriter writer)
 {
     WebPart webPartToConnect = this.WebPartToConnect;
     if (webPartToConnect != null)
     {
         ConsumerConnectionPointCollection enabledConsumerConnectionPoints = base.WebPartManager.GetEnabledConsumerConnectionPoints(webPartToConnect);
         bool flag = true;
         Label label = new Label {
             Page = this.Page,
             AssociatedControlInControlTree = false
         };
         foreach (ConsumerConnectionPoint point in enabledConsumerConnectionPoints)
         {
             DropDownList list = (DropDownList) this._connectDropDownLists[point];
             if ((list != null) && list.Enabled)
             {
                 if (flag)
                 {
                     string connectToProviderTitle = this.ConnectToProviderTitle;
                     if (!string.IsNullOrEmpty(connectToProviderTitle))
                     {
                         label.Text = connectToProviderTitle;
                         label.ApplyStyle(base.LabelStyle);
                         label.AssociatedControlID = string.Empty;
                         label.RenderControl(writer);
                         writer.WriteBreak();
                     }
                     string connectToProviderInstructionText = this.ConnectToProviderInstructionText;
                     if (!string.IsNullOrEmpty(connectToProviderInstructionText))
                     {
                         writer.WriteBreak();
                         label.Text = connectToProviderInstructionText;
                         label.ApplyStyle(base.InstructionTextStyle);
                         label.AssociatedControlID = string.Empty;
                         label.RenderControl(writer);
                         writer.WriteBreak();
                     }
                     flag = false;
                 }
                 writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);
                 writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
                 writer.RenderBeginTag(HtmlTextWriterTag.Table);
                 writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                 writer.RenderBeginTag(HtmlTextWriterTag.Td);
                 label.ApplyStyle(base.LabelStyle);
                 label.Text = this.GetText;
                 label.AssociatedControlID = string.Empty;
                 label.RenderControl(writer);
                 writer.RenderEndTag();
                 base.LabelStyle.AddAttributesToRender(writer, this);
                 writer.RenderBeginTag(HtmlTextWriterTag.Td);
                 writer.WriteEncodedText(point.DisplayName);
                 writer.RenderEndTag();
                 writer.RenderEndTag();
                 writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                 writer.RenderBeginTag(HtmlTextWriterTag.Td);
                 label.Text = this.GetFromText;
                 label.AssociatedControlID = list.ClientID;
                 label.RenderControl(writer);
                 writer.RenderEndTag();
                 writer.RenderBeginTag(HtmlTextWriterTag.Td);
                 list.ApplyStyle(base.EditUIStyle);
                 list.RenderControl(writer);
                 writer.RenderEndTag();
                 writer.RenderEndTag();
                 writer.RenderEndTag();
                 WebPartVerb connectVerb = this.ConnectVerb;
                 connectVerb.EventArgument = string.Join('$'.ToString(CultureInfo.InvariantCulture), new string[] { "connect", "consumer", point.ID });
                 this.RenderVerb(writer, connectVerb);
                 writer.RenderEndTag();
             }
         }
         writer.AddStyleAttribute(HtmlTextWriterStyle.TextAlign, "right");
         writer.RenderBeginTag(HtmlTextWriterTag.Div);
         WebPartVerb cancelVerb = this.CancelVerb;
         cancelVerb.EventArgument = "cancel";
         this.RenderVerb(writer, cancelVerb);
         writer.RenderEndTag();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:80,代码来源:ConnectionsZone.cs

示例6: RenderNoExistingConnection

 private void RenderNoExistingConnection(HtmlTextWriter writer) {
     string noConnection = NoExistingConnectionTitle;
     if (!String.IsNullOrEmpty(noConnection)) {
         Label label = new Label();
         label.Text = noConnection;
         label.Page = Page;
         label.ApplyStyle(LabelStyle);
         label.RenderControl(writer);
         writer.WriteBreak();
         writer.WriteBreak();
     }
     string instructions = NoExistingConnectionInstructionText;
     if (!String.IsNullOrEmpty(instructions)) {
         Label label = new Label();
         label.Text = instructions;
         label.Page = Page;
         label.ApplyStyle(InstructionTextStyle);
         label.RenderControl(writer);
         writer.WriteBreak();
         writer.WriteBreak();
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:22,代码来源:ConnectionsZone.cs

示例7: InitializeItem

		protected virtual void InitializeItem (SiteMapNodeItem item)
		{
			switch (item.ItemType) {
				case SiteMapNodeItemType.Root:
					if (RootNodeTemplate != null) {
						item.ApplyStyle (NodeStyle);
						item.ApplyStyle (RootNodeStyle);
						RootNodeTemplate.InstantiateIn (item);
					}
					else {
						WebControl c = CreateNodeControl (true, item);
						c.ApplyStyle (NodeStyle);
						c.ApplyStyle (RootNodeStyle);
						item.Controls.Add (c);
					}
					break;

				case SiteMapNodeItemType.Current:
					if (CurrentNodeTemplate != null) {
						item.ApplyStyle (NodeStyle);
						item.ApplyStyle (CurrentNodeStyle);
						CurrentNodeTemplate.InstantiateIn (item);
					}
					else {
						WebControl c = CreateNodeControl (RenderCurrentNodeAsLink, item);
						c.ApplyStyle (NodeStyle);
						c.ApplyStyle (CurrentNodeStyle);
						item.Controls.Add (c);
					}
					break;
					
				case SiteMapNodeItemType.Parent:
					if (NodeTemplate != null) {
						item.ApplyStyle (NodeStyle);
						NodeTemplate.InstantiateIn (item);
					}
					else {
						WebControl c = CreateNodeControl (true, item);
						c.ApplyStyle (NodeStyle);
						item.Controls.Add (c);
					}
					break;
					
				case SiteMapNodeItemType.PathSeparator:
					if (PathSeparatorTemplate != null) {
						item.ApplyStyle (PathSeparatorStyle);
						PathSeparatorTemplate.InstantiateIn (item);
					}
					else {
						Label h = new Label ();
						h.Text = PathSeparator;
						h.ApplyStyle (PathSeparatorStyle);
						item.Controls.Add (h);
					}
					break;
			}
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:57,代码来源:SiteMapPath.cs

示例8: RenderExistingConnections

 private void RenderExistingConnections(HtmlTextWriter writer)
 {
     WebPartManager webPartManager = base.WebPartManager;
     bool flag = false;
     bool flag2 = false;
     bool flag3 = false;
     if (webPartManager != null)
     {
         WebPart webPartToConnect = this.WebPartToConnect;
         WebPartConnectionCollection connections = webPartManager.Connections;
         foreach (WebPartConnection connection in connections)
         {
             if (connection.Provider == webPartToConnect)
             {
                 if (!flag)
                 {
                     this.RenderInstructionTitle(writer);
                     this.RenderInstructionText(writer);
                     flag = true;
                 }
                 if (!flag2)
                 {
                     writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);
                     base.LabelStyle.AddAttributesToRender(writer, this);
                     writer.RenderBeginTag(HtmlTextWriterTag.Legend);
                     writer.Write(this.ConsumersTitle);
                     writer.RenderEndTag();
                     string consumersInstructionText = this.ConsumersInstructionText;
                     if (!string.IsNullOrEmpty(consumersInstructionText))
                     {
                         writer.WriteBreak();
                         Label label = new Label {
                             Text = consumersInstructionText,
                             Page = this.Page
                         };
                         label.ApplyStyle(base.InstructionTextStyle);
                         label.RenderControl(writer);
                         writer.WriteBreak();
                     }
                     flag2 = true;
                 }
                 this.RenderExistingConsumerConnection(writer, connection);
             }
         }
         if (flag2)
         {
             writer.RenderEndTag();
         }
         foreach (WebPartConnection connection2 in connections)
         {
             if (connection2.Consumer == webPartToConnect)
             {
                 if (!flag)
                 {
                     this.RenderInstructionTitle(writer);
                     this.RenderInstructionText(writer);
                     flag = true;
                 }
                 if (!flag3)
                 {
                     writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);
                     base.LabelStyle.AddAttributesToRender(writer, this);
                     writer.RenderBeginTag(HtmlTextWriterTag.Legend);
                     writer.Write(this.ProvidersTitle);
                     writer.RenderEndTag();
                     string providersInstructionText = this.ProvidersInstructionText;
                     if (!string.IsNullOrEmpty(providersInstructionText))
                     {
                         writer.WriteBreak();
                         Label label2 = new Label {
                             Text = providersInstructionText,
                             Page = this.Page
                         };
                         label2.ApplyStyle(base.InstructionTextStyle);
                         label2.RenderControl(writer);
                         writer.WriteBreak();
                     }
                     flag3 = true;
                 }
                 this.RenderExistingProviderConnection(writer, connection2);
             }
         }
     }
     if (flag3)
     {
         writer.RenderEndTag();
     }
     if (flag)
     {
         writer.WriteBreak();
     }
     else
     {
         this.RenderNoExistingConnection(writer);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:96,代码来源:ConnectionsZone.cs

示例9: RenderInstructionText

 private void RenderInstructionText(HtmlTextWriter writer)
 {
     string instructionText = this.InstructionText;
     if (!string.IsNullOrEmpty(instructionText))
     {
         Label label = new Label {
             Text = instructionText,
             Page = this.Page
         };
         label.ApplyStyle(base.InstructionTextStyle);
         label.RenderControl(writer);
         writer.WriteBreak();
         writer.WriteBreak();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:ConnectionsZone.cs

示例10: InstantiateIn

			public void InstantiateIn (Control container)
			{
				Table table = new Table ();
				table.CellPadding = 0;

				bool twoCells = _owner.TextLayout == LoginTextLayout.TextOnLeft;

				// row 0
				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.QuestionTitleText), null, _owner.TitleTextStyle, null, twoCells));

				// row 1
				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.QuestionInstructionText), null, _owner.InstructionTextStyle, null, twoCells));

				// row 2
				Literal UserNameLiteral = new Literal ();
				UserNameLiteral.ID = "UserName";

				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.UserNameLabelText), UserNameLiteral, _owner.LabelStyle, _owner.LabelStyle, twoCells));

				// row 3
				Literal QuestionLiteral = new Literal ();
				QuestionLiteral.ID = "Question";

				table.Rows.Add (
					TemplateUtils.CreateRow (new LiteralControl (_owner.QuestionLabelText), QuestionLiteral, _owner.LabelStyle, _owner.LabelStyle, twoCells));

				// row 5
				TextBox AnswerTextBox = new TextBox ();
				AnswerTextBox.ID = "Answer";
				AnswerTextBox.ApplyStyle (_owner.TextBoxStyle);

				Label AnswerLabel = new Label ();
				AnswerLabel.ID = "AnswerLabel";
				AnswerLabel.AssociatedControlID = "Answer";
				AnswerLabel.Text = _owner.AnswerLabelText;
				AnswerLabel.ApplyStyle (_owner.LabelStyle);

				RequiredFieldValidator AnswerRequired = new RequiredFieldValidator ();
				AnswerRequired.ID = "AnswerRequired";
				AnswerRequired.ControlToValidate = "Answer";
				AnswerRequired.ErrorMessage = _owner.AnswerRequiredErrorMessage;
				AnswerRequired.ToolTip = _owner.AnswerRequiredErrorMessage;
				AnswerRequired.Text = "*";
				AnswerRequired.ValidationGroup = _owner.ID;
				AnswerRequired.ApplyStyle (_owner.ValidatorTextStyle);

				if (twoCells) {
					TableRow row = TemplateUtils.CreateRow (AnswerLabel, AnswerTextBox, null, null, twoCells);
					row.Cells [1].Controls.Add (AnswerRequired);
					table.Rows.Add (row);
				}
				else {
					table.Rows.Add (TemplateUtils.CreateRow (AnswerLabel, null, null, null, twoCells));
					TableRow row = TemplateUtils.CreateRow (AnswerTextBox, null, null, null, twoCells);
					row.Cells [0].Controls.Add (AnswerRequired);
					table.Rows.Add (row);
				}

				// row 6
				Literal FailureText = new Literal ();
				FailureText.ID = "FailureText";
				if (_owner.FailureTextStyle.ForeColor.IsEmpty)
					_owner.FailureTextStyle.ForeColor = System.Drawing.Color.Red;
				table.Rows.Add (TemplateUtils.CreateRow (FailureText, null, _owner.FailureTextStyle, null, twoCells));

				// row 7
				WebControl SubmitButton = null;
				switch (_owner.SubmitButtonType) {
					case ButtonType.Button:
						SubmitButton = new Button ();
						break;
					case ButtonType.Image:
						SubmitButton = new ImageButton ();
						break;
					case ButtonType.Link:
						SubmitButton = new LinkButton ();
						break;
				}

				SubmitButton.ID = "SubmitButton";
				SubmitButton.ApplyStyle (_owner.SubmitButtonStyle);
				((IButtonControl) SubmitButton).CommandName = PasswordRecovery.SubmitButtonCommandName;
				((IButtonControl) SubmitButton).Text = _owner.SubmitButtonText;
				((IButtonControl) SubmitButton).ValidationGroup = _owner.ID;

				TableRow buttonRow = TemplateUtils.CreateRow (SubmitButton, null, null, null, twoCells);
				buttonRow.Cells [0].HorizontalAlign = HorizontalAlign.Right;
				table.Rows.Add (buttonRow);

				// row 8
				table.Rows.Add (
					TemplateUtils.CreateHelpRow (
					_owner.HelpPageUrl, _owner.HelpPageText, _owner.HelpPageIconUrl, _owner.HyperLinkStyle, twoCells));

				container.Controls.Add (table);
			}
开发者ID:Profit0004,项目名称:mono,代码行数:99,代码来源:PasswordRecovery.cs

示例11: RenderContents

        protected override void RenderContents(HtmlTextWriter writer)
        {
            //writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            //writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "4");

            //writer.RenderBeginTag(HtmlTextWriterTag.Table);
            //writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            //writer.RenderBeginTag(HtmlTextWriterTag.Td);

            this.PartPropertyValue.RenderControl(writer);

            if (_displayErrorMessage)
            {
                writer.WriteBreak();
                Label errorMessage = new Label();
                errorMessage.Text = "Error converting type";
                errorMessage.ApplyStyle(this.Zone.ErrorStyle);
                errorMessage.RenderControl(writer);
            }

            //writer.RenderEndTag();  // Td
            //writer.RenderEndTag();  // Tr
            //writer.RenderEndTag();  // Table
        }
开发者ID:kohku,项目名称:codefactory,代码行数:24,代码来源:ModuleEditorPart.cs

示例12: RenderCatalogPartLinks

        protected virtual void RenderCatalogPartLinks(HtmlTextWriter writer) {
            RenderInstructionText(writer);

            CatalogPart selectedCatalogPart = SelectedCatalogPart;
            foreach (CatalogPart catalogPart in CatalogParts) {
                WebPartDescriptionCollection availableWebParts = catalogPart.GetAvailableWebPartDescriptions();
                int count = ((availableWebParts != null) ? availableWebParts.Count : 0);

                string displayTitle = catalogPart.DisplayTitle;
                // 
                string text = displayTitle + " (" + count.ToString(CultureInfo.CurrentCulture) + ")";

                if (catalogPart == selectedCatalogPart) {
                    Label label = new Label();
                    label.Text = text;
                    label.Page = Page;
                    label.ApplyStyle(SelectedPartLinkStyle);
                    label.RenderControl(writer);
                }
                else {
                    Debug.Assert(!String.IsNullOrEmpty(catalogPart.ID));
                    string eventArgument = selectEventArgument + ID_SEPARATOR + catalogPart.ID;

                    ZoneLinkButton linkButton = new ZoneLinkButton(this, eventArgument);
                    linkButton.Text = text;
                    linkButton.ToolTip = SR.GetString(SR.CatalogZoneBase_SelectCatalogPart, displayTitle);
                    linkButton.Page = Page;
                    linkButton.ApplyStyle(PartLinkStyle);
                    linkButton.RenderControl(writer);
                }

                writer.WriteBreak();
            }

            writer.WriteBreak();
        }
开发者ID:uQr,项目名称:referencesource,代码行数:36,代码来源:CatalogZoneBase.cs

示例13: RenderInstructionText

        private void RenderInstructionText(HtmlTextWriter writer, ref bool firstCell) {
            string instructionText = InstructionText;
            if (!String.IsNullOrEmpty(instructionText)) {
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                firstCell = false;

                Label label = new Label();
                label.Text = instructionText;
                label.Page = Page;
                label.ApplyStyle(InstructionTextStyle);
                label.RenderControl(writer);

                writer.RenderEndTag();  // Td
                writer.RenderEndTag();  // Tr
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:17,代码来源:EditorZoneBase.cs

示例14: RenderInstructionText

 private void RenderInstructionText(HtmlTextWriter writer, ref bool firstCell)
 {
     string instructionText = this.InstructionText;
     if (!string.IsNullOrEmpty(instructionText))
     {
         writer.RenderBeginTag(HtmlTextWriterTag.Tr);
         writer.RenderBeginTag(HtmlTextWriterTag.Td);
         firstCell = false;
         Label label = new Label {
             Text = instructionText,
             Page = this.Page
         };
         label.ApplyStyle(base.InstructionTextStyle);
         label.RenderControl(writer);
         writer.RenderEndTag();
         writer.RenderEndTag();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:EditorZoneBase.cs

示例15: RenderInstructionText

 private void RenderInstructionText(HtmlTextWriter writer) {
     string instructionText = InstructionText;
     if (!String.IsNullOrEmpty(instructionText)) {
         Label label = new Label();
         label.Text = instructionText;
         label.Page = Page;
         label.ApplyStyle(InstructionTextStyle);
         label.RenderControl(writer);
         writer.WriteBreak();
         writer.WriteBreak();
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:12,代码来源:ConnectionsZone.cs


注:本文中的System.Web.UI.WebControls.Label.ApplyStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。