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


C# RockTextBox.AddCssClass方法代码示例

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


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

示例1: FilterValueControl

 /// <summary>
 /// Gets the filter value control with the specified FilterMode
 /// </summary>
 /// <param name="configurationValues">The configuration values.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="required">if set to <c>true</c> [required].</param>
 /// <param name="filterMode">The filter mode.</param>
 /// <returns></returns>
 public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required, FilterMode filterMode )
 {
     var control = new RockTextBox { ID = id };
     control.ID = string.Format( "{0}_ctlCompareValue", id );
     control.AddCssClass( "js-filter-control" );
     return control;
 }
开发者ID:NewSpring,项目名称:Rock,代码行数:15,代码来源:EmailFieldType.cs

示例2: CreateChildControls

        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            _cbCurrent = new CheckBox();
            _cbCurrent.ID = this.ID + "_cbCurrent";
            _cbCurrent.AddCssClass( "js-current-date-checkbox" );
            _cbCurrent.Text = "Current Date";
            this.Controls.Add( _cbCurrent );

            _nbDayOffset = new RockTextBox();
            _nbDayOffset.ID = this.ID + "_nbDayOffset";
            _nbDayOffset.Help = "Enter the number of days after the current date to use as the date. Use a negative number to specify days before.";
            _nbDayOffset.AddCssClass( "input-width-md js-current-date-offset" );
            _nbDayOffset.Label = "+- Days";
            this.Controls.Add( _nbDayOffset );
        }
开发者ID:SparkDevNetwork,项目名称:Rock,代码行数:20,代码来源:DatePicker.cs

示例3: CreateChildControls

        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hfValue.ID = this.ID + "_hfValue";
            Controls.Add( _hfValue );

            _actionControls = new List<RockTextBox>();
            _buttonHtmlControls = new List<RockDropDownList>();
            _activityControls = new List<RockDropDownList>();
            _responseControls = new List<RockTextBox>();

            string[] nameValues = this.Value.Split( new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries );
            for ( int i = 0; i < nameValues.Length; i++ )
            {
                string[] nameValueResponse = nameValues[i].Split( new char[] { '^' } );

                var tbAction = new RockTextBox();
                tbAction.ID = this.ID + "_tbAction" + i.ToString();
                Controls.Add( tbAction );
                tbAction.Placeholder = "Action";
                tbAction.AddCssClass( "form-action-key" );
                tbAction.AddCssClass( "form-control" );
                tbAction.AddCssClass( "js-form-action-input" );
                tbAction.Text = nameValueResponse.Length > 0 ? nameValueResponse[0] : string.Empty;
                _actionControls.Add( tbAction );

                var ddlButtonHtml = new RockDropDownList();
                ddlButtonHtml.ID = this.ID + "_ddlButtonHtml" + i.ToString();
                Controls.Add( ddlButtonHtml );
                ddlButtonHtml.AddCssClass( "form-action-button" );
                ddlButtonHtml.AddCssClass( "form-control" );
                ddlButtonHtml.AddCssClass( "js-form-action-input" );
                var definedType = Rock.Web.Cache.DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.BUTTON_HTML.AsGuid() );
                foreach( var definedValue in definedType.DefinedValues )
                {
                    var li = new ListItem( definedValue.Value, definedValue.Guid.ToString() );
                    li.Selected = nameValueResponse.Length > 1 && li.Value.Equals( nameValueResponse[1], StringComparison.OrdinalIgnoreCase );
                    ddlButtonHtml.Items.Add( li );
                }
                _buttonHtmlControls.Add( ddlButtonHtml );

                var ddlActivity = new RockDropDownList();
                ddlActivity.ID = this.ID + "_ddlActivity" + i.ToString();
                Controls.Add( ddlActivity );
                ddlActivity.AddCssClass( "form-action-value" );
                ddlActivity.AddCssClass( "form-control" );
                ddlActivity.AddCssClass( "js-form-action-input" );
                ddlActivity.DataTextField = "Value";
                ddlActivity.DataValueField = "Key";
                ddlActivity.DataSource = Activities;
                ddlActivity.DataBind();
                ddlActivity.Items.Insert( 0, new ListItem( string.Empty, string.Empty ) );
                foreach(ListItem li in ddlActivity.Items)
                {
                    li.Selected = nameValueResponse.Length > 2 && li.Value.Equals( nameValueResponse[2], StringComparison.OrdinalIgnoreCase );
                }
                _activityControls.Add( ddlActivity );

                var tbResponse = new RockTextBox();
                tbResponse.ID = this.ID + "_tbResponse" + i.ToString();
                Controls.Add( tbResponse );
                tbResponse.Placeholder = "Response Text";
                tbResponse.AddCssClass( "form-action-response" );
                tbResponse.AddCssClass( "form-control" );
                tbResponse.AddCssClass( "js-form-action-input" );
                tbResponse.Text = nameValueResponse.Length > 3 ? nameValueResponse[3] : string.Empty;
                _responseControls.Add( tbResponse );
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:73,代码来源:WorkflowFormActionList.cs

示例4: AddFieldTypeControls

        /// <summary>
        /// Adds the field type controls.
        /// </summary>
        /// <param name="parentControl">The filter control.</param>
        /// <param name="controls">The controls.</param>
        /// <param name="entityField">The entity field.</param>
        protected void AddFieldTypeControls( Control parentControl, List<Control> controls, EntityField entityField )
        {
            string controlIdPrefix = string.Format( "{0}_{1}", parentControl.ID, entityField.FieldKind == FieldKind.Attribute ? entityField.AttributeGuid.Value.ToString("n") : entityField.Name );
            switch ( entityField.FilterFieldType )
            {
                case SystemGuid.FieldType.DATE:

                    var ddlDateCompare = ComparisonControl( DateFilterComparisonTypes );
                    ddlDateCompare.ID = string.Format( "{0}_ddlDateCompare", controlIdPrefix );
                    ddlDateCompare.AddCssClass( "js-filter-compare" );
                    parentControl.Controls.Add( ddlDateCompare );
                    controls.Add( ddlDateCompare );

                    var datePicker = new DatePicker();
                    datePicker.ID = string.Format( "{0}_dtPicker", controlIdPrefix );
                    datePicker.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( datePicker );
                    controls.Add( datePicker );

                    break;

                case SystemGuid.FieldType.TIME:

                    var ddlTimeCompare = ComparisonControl( DateFilterComparisonTypes );
                    ddlTimeCompare.ID = string.Format( "{0}_ddlTimeCompare", controlIdPrefix );
                    ddlTimeCompare.AddCssClass( "js-filter-compare" );
                    parentControl.Controls.Add( ddlTimeCompare );
                    controls.Add( ddlTimeCompare );

                    var timePicker = new TimePicker();
                    timePicker.ID = string.Format( "{0}_timePicker", controlIdPrefix );
                    timePicker.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( timePicker );
                    controls.Add( timePicker );

                    break;

                case SystemGuid.FieldType.INTEGER:
                case SystemGuid.FieldType.DECIMAL:

                    var ddlNumberCompare = ComparisonControl( NumericFilterComparisonTypes );
                    ddlNumberCompare.ID = string.Format( "{0}_ddlNumberCompare", controlIdPrefix );
                    ddlNumberCompare.AddCssClass( "js-filter-compare" );
                    parentControl.Controls.Add( ddlNumberCompare );
                    controls.Add( ddlNumberCompare );

                    var numberBox = new NumberBox();
                    numberBox.ID = string.Format( "{0}_numberBox", controlIdPrefix );
                    numberBox.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( numberBox );
                    controls.Add( numberBox );

                    numberBox.FieldName = entityField.Title;

                    break;

                case SystemGuid.FieldType.MULTI_SELECT:

                    var cblMultiSelect = new RockCheckBoxList();
                    cblMultiSelect.ID = string.Format( "{0}_cblMultiSelect", controlIdPrefix );
                    parentControl.Controls.Add( cblMultiSelect );
                    cblMultiSelect.RepeatDirection = RepeatDirection.Horizontal;
                    controls.Add( cblMultiSelect );

                    if ( entityField.FieldKind == FieldKind.Property )
                    {
                        if ( entityField.PropertyType.IsEnum )
                        {
                            // Enumeration property
                            foreach ( var value in Enum.GetValues( entityField.PropertyType ) )
                            {
                                cblMultiSelect.Items.Add( new ListItem( Enum.GetName( entityField.PropertyType, value ).SplitCase() ) );
                            }
                        }
                        else if ( entityField.DefinedTypeGuid.HasValue )
                        {
                            // Defined Value Properties
                            var definedType = DefinedTypeCache.Read( entityField.DefinedTypeGuid.Value );
                            if ( definedType != null )
                            {
                                foreach ( var definedValue in definedType.DefinedValues )
                                {
                                    cblMultiSelect.Items.Add( new ListItem( definedValue.Name, definedValue.Guid.ToString() ) );
                                }
                            }
                        }
                    }
                    else
                    {
                        var attribute = AttributeCache.Read( entityField.AttributeGuid.Value );
                        if ( attribute != null )
                        {
                            switch ( attribute.FieldType.Guid.ToString().ToUpper() )
                            {
//.........这里部分代码省略.........
开发者ID:jondhinkle,项目名称:Rock,代码行数:101,代码来源:EntityFieldFilter.cs

示例5: CreateChildControls

        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls( this, Controls );

            _date = new TextBox();
            _date.ID =  "tbDate";
            _date.AddCssClass( "form-control js-datetime-date" );
            Controls.Add( _date );

            _time = new TextBox();
            _time.ID = "tbTime";
            _time.AddCssClass( "form-control js-datetime-time");
            Controls.Add( _time );

            _cbCurrent = new CheckBox();
            _cbCurrent.ID = "cbCurrent";
            _cbCurrent.AddCssClass( "js-current-datetime-checkbox" );
            _cbCurrent.Text = "Current Time";
            this.Controls.Add( _cbCurrent );

            _nbTimeOffset = new RockTextBox();
            _nbTimeOffset.ID = "nbTimeOffset";
            _nbTimeOffset.Help = "Enter the number of minutes after the current time to use as the date. Use a negative number to specify minutes before.";
            _nbTimeOffset.AddCssClass( "input-width-md js-current-datetime-offset" );
            _nbTimeOffset.Label = "+- Minutes";
            this.Controls.Add( _nbTimeOffset );

            RequiredFieldValidator.ControlToValidate = _date.ID;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:34,代码来源:DateTimePicker.cs

示例6: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var pGroupPicker = new GroupPicker();
            pGroupPicker.AllowMultiSelect = true;
            pGroupPicker.ID = filterControl.ID + "_pGroupPicker";
            pGroupPicker.AddCssClass( "js-group-picker" );
            filterControl.Controls.Add( pGroupPicker );

            var cbChildGroups = new RockCheckBox();
            cbChildGroups.ID = filterControl.ID + "_cbChildGroups";
            cbChildGroups.AddCssClass( "js-child-groups" );
            cbChildGroups.Text = "Include Child Groups";
            filterControl.Controls.Add( cbChildGroups );

            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes );
            ddlIntegerCompare.Label = "Attendance Count";
            ddlIntegerCompare.ID = filterControl.ID + "_ddlIntegerCompare";
            ddlIntegerCompare.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlIntegerCompare );

            var tbAttendedCount = new RockTextBox();
            tbAttendedCount.ID = filterControl.ID + "_2";
            tbAttendedCount.Label = "&nbsp;"; // give it whitespace label so it lines up nicely
            tbAttendedCount.AddCssClass( "js-attended-count" );
            filterControl.Controls.Add( tbAttendedCount );

            var slidingDateRangePicker = new SlidingDateRangePicker();
            slidingDateRangePicker.Label = "Date Range";
            slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker";
            slidingDateRangePicker.AddCssClass( "js-sliding-date-range" );
            filterControl.Controls.Add( slidingDateRangePicker );

            var controls = new Control[5] { pGroupPicker, cbChildGroups, ddlIntegerCompare, tbAttendedCount, slidingDateRangePicker };

            // convert pipe to comma delimited
            var defaultDelimitedValues = slidingDateRangePicker.DelimitedValues.Replace( "|", "," );
            var defaultCount = 4;

            // set the default values in case this is a newly added filter
            SetSelection(
                entityType,
                controls,
                string.Format( "{0}|{1}|{2}|{3}|false", string.Empty, ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString(), defaultCount, defaultDelimitedValues ) );

            return controls;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:50,代码来源:GroupAttendanceFilter.cs

示例7: FilterValueControl

 /// <summary>
 /// Gets the filter value control.
 /// </summary>
 /// <param name="configurationValues">The configuration values.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="required">if set to <c>true</c> [required].</param>
 /// <returns></returns>
 public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required )
 {
     var tbValue = new RockTextBox();
     tbValue.ID = string.Format( "{0}_ctlCompareValue", id );
     tbValue.AddCssClass( "js-filter-control" );
     return tbValue;
 }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:14,代码来源:MemoFieldType.cs

示例8: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var gtpGroupType = new GroupTypePicker();
            gtpGroupType.ID = filterControl.ID + "_0";
            gtpGroupType.AddCssClass( "js-group-type" );
            filterControl.Controls.Add( gtpGroupType );

            gtpGroupType.UseGuidAsValue = true;
            gtpGroupType.GroupTypes = new GroupTypeService( new RockContext() ).Queryable().OrderBy(a => a.Name).ToList();

            var cbChildGroupTypes = new RockCheckBox();
            cbChildGroupTypes.ID = filterControl.ID + "_cbChildGroupTypes";
            cbChildGroupTypes.AddCssClass( "js-child-group-types" );
            cbChildGroupTypes.Text = "Include Child Group Types(s)";
            filterControl.Controls.Add( cbChildGroupTypes );

            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes );
            ddlIntegerCompare.Label = "Attendance Count";
            ddlIntegerCompare.ID = filterControl.ID + "_ddlIntegerCompare";
            ddlIntegerCompare.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlIntegerCompare );

            var tbAttendedCount = new RockTextBox();
            tbAttendedCount.ID = filterControl.ID + "_2";
            tbAttendedCount.Label = "&nbsp;"; // give it whitespace label so it lines up nicely
            tbAttendedCount.AddCssClass( "js-attended-count" );
            filterControl.Controls.Add( tbAttendedCount );

            var slidingDateRangePicker = new SlidingDateRangePicker();
            slidingDateRangePicker.Label = "Date Range";
            slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker";
            slidingDateRangePicker.AddCssClass( "js-sliding-date-range" );
            filterControl.Controls.Add( slidingDateRangePicker );

            var controls = new Control[5] { gtpGroupType, cbChildGroupTypes, ddlIntegerCompare, tbAttendedCount, slidingDateRangePicker };

            // convert pipe to comma delimited
            var defaultDelimitedValues = slidingDateRangePicker.DelimitedValues.Replace( "|", "," );
            var defaultCount = 4;

            // set the default values in case this is a newly added filter
            SetSelection(
                entityType,
                controls,
                string.Format( "{0}|{1}|{2}|{3}|false", gtpGroupType.Items.Count > 0 ? gtpGroupType.Items[0].Value : "0", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString(), defaultCount, defaultDelimitedValues ) );

            return controls;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:52,代码来源:GroupTypeAttendanceFilter.cs

示例9: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var controls = new List<Control>();

            ddlStringFilterComparison = ComparisonHelper.ComparisonControl( ComparisonHelper.StringFilterComparisonTypes );
            ddlStringFilterComparison.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
            ddlStringFilterComparison.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlStringFilterComparison );
            controls.Add( ddlStringFilterComparison );

            tbPostalCode = new RockTextBox();
            tbPostalCode.ID = filterControl.ID + "_tbPostalCode";
            tbPostalCode.AddCssClass( "js-filter-control" );
            filterControl.Controls.Add( tbPostalCode );
            controls.Add( tbPostalCode );

            return controls.ToArray();
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:22,代码来源:PostalCodeFilter.cs


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