本文整理汇总了C#中System.Web.UI.WebControls.WebControl.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# WebControl.ToArray方法的具体用法?C# WebControl.ToArray怎么用?C# WebControl.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.WebControl
的用法示例。
在下文中一共展示了WebControl.ToArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getSectionClass
void ControlTreeDataLoader.LoadData()
{
CssClass =
CssClass.ConcatenateWithSpace(
allStylesBothStatesClass + " " +
( style == SectionStyle.Normal ? getSectionClass( normalClosedClass, normalExpandedClass ) : getSectionClass( boxClosedClass, boxExpandedClass ) ) );
if( heading.Any() ) {
var headingControls =
new WebControl( HtmlTextWriterTag.H1 ) { CssClass = headingClass }.AddControlsReturnThis( heading.GetLiteralControl() )
.ToSingleElementArray()
.Concat( postHeadingControls );
if( expanded.HasValue ) {
var toggleClasses = style == SectionStyle.Normal ? new[] { normalClosedClass, normalExpandedClass } : new[] { boxClosedClass, boxExpandedClass };
var headingContainer =
new Block(
new[] { new EwfLabel { Text = "Click to Expand", CssClass = closeClass }, new EwfLabel { Text = "Click to Close", CssClass = expandClass } }.Concat(
headingControls ).ToArray() ) { CssClass = headingClass };
var actionControlStyle = new CustomActionControlStyle( c => c.AddControlsReturnThis( headingContainer ) );
this.AddControlsReturnThis(
disableStatePersistence
? new CustomButton( () => "$( '#" + ClientID + "' ).toggleClass( '" + StringTools.ConcatenateWithDelimiter( " ", toggleClasses ) + "', 200 )" )
{
ActionControlStyle = actionControlStyle
}
: new ToggleButton( this.ToSingleElementArray(), actionControlStyle, toggleClasses: toggleClasses ) as Control );
}
else {
var headingContainer = new Block( headingControls.ToArray() ) { CssClass = headingClass };
this.AddControlsReturnThis( new Block( headingContainer ) );
}
}
if( contentControls.Any() )
this.AddControlsReturnThis( new Block( contentControls.ToArray() ) { CssClass = contentClass } );
}