コード例 #1
0
        private WebControl getIconButton()
        {
            var icon  = new FontAwesomeIcon("fa-calendar", "datepickerIcon");
            var style = new CustomActionControlStyle(control => control.AddControlsReturnThis(icon));

            return(new CustomButton(() => "$( '#{0}' ).datepicker( 'show' )".FormatWith(textBox.TextBoxClientId))
            {
                ActionControlStyle = style, CssClass = "icon"
            });
        }
コード例 #2
0
        private WebControl getIconButton()
        {
            var parent = new EwfLabel {
                CssClass = "fa-stack datetimepickerIcon"
            };
            var iconCal  = new FontAwesomeIcon("fa-calendar-o", "fa-stack-2x");
            var iconTime = new FontAwesomeIcon("fa-clock-o", "fa-stack-1x");

            iconTime.Style.Add(HtmlTextWriterStyle.Position, "relative");
            iconTime.Style.Add(HtmlTextWriterStyle.Top, ".20em");
            parent.AddControlsReturnThis(iconCal, iconTime);

            var style = new CustomActionControlStyle(control => control.AddControlsReturnThis(parent));

            return(new CustomButton(() => "$( '#{0}' ).datetimepicker( 'show' )".FormatWith(textBox.TextBoxClientId))
            {
                ActionControlStyle = style,
                CssClass = "icon"
            });
        }
コード例 #3
0
 private WebControl getIconButton()
 {
     var icon = new FontAwesomeIcon( "fa-clock-o", "timepickerIcon" );
     var style = new CustomActionControlStyle( control => control.AddControlsReturnThis( icon ) );
     return new CustomButton( () => "$( '#{0}' ).timepicker( 'show' )".FormatWith( textBox.TextBoxClientId ) ) { ActionControlStyle = style, CssClass = "icon" };
 }
コード例 #4
0
        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 } );
        }