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


C# FilterSettings.ToSelectionString方法代码示例

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


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

示例1: GetSelection

        /// <summary>
        /// Gets a formatted string representing the current filter control values.
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="controls">The collection of controls used to set the filter values.</param>
        /// <returns>
        /// A formatted string.
        /// </returns>
        public override string GetSelection( Type entityType, Control[] controls )
        {
            var ddlDataView = controls.GetByName<DataViewPicker>( _CtlDataView );
            var ddlCompare = controls.GetByName<RockDropDownList>( _CtlComparison );
            var nbValue = controls.GetByName<NumberBox>( _CtlMemberCount );

            var settings = new FilterSettings();

            settings.PersonDataViewGuid = DataComponentSettingsHelper.GetDataViewGuid( ddlDataView.SelectedValue );
            settings.PersonCountComparison = ddlCompare.SelectedValueAsEnum<ComparisonType>( ComparisonType.GreaterThan );
            settings.PersonCount = nbValue.Text.AsInteger();

            return settings.ToSelectionString();
        }
开发者ID:azturner,项目名称:Rock,代码行数:22,代码来源:ContainsPeopleFilter.cs

示例2: GetSelection

        /// <summary>
        /// Gets the selection.
        /// Implement this version of GetSelection if your DataFilterComponent works the same in all FilterModes
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="controls">The collection of controls used to set the filter values.</param>
        /// <returns>
        /// A formatted string.
        /// </returns>
        public override string GetSelection( Type entityType, Control[] controls )
        {
            // Get selection control instances.
            var pnlGroupAttributeFilterControls = controls.GetByName<DynamicControlsPanel>( _CtlGroup );
            var ddlProperty = controls.GetByName<DropDownList>( _CtlProperty );

            if (pnlGroupAttributeFilterControls == null)
            {
                return null;
            }

            var settings = new FilterSettings();
            settings.AttributeKey = ddlProperty.SelectedValue;

            var entityFields = GetGroupMemberAttributes();
            var entityField = entityFields.FirstOrDefault( f => f.Name == ddlProperty.SelectedValue );
            if (entityField != null)
            {
                var panelControls = new List<Control>();
                panelControls.AddRange( pnlGroupAttributeFilterControls.Controls.OfType<Control>() );

                var control = panelControls.FirstOrDefault( c => c.ID.EndsWith( "_" + entityField.Name ) );

                if (control != null)
                {
                    entityField.FieldType.Field.GetFilterValues( control, entityField.FieldConfig, FilterMode.AdvancedFilter ).ForEach( v => settings.AttributeFilterSettings.Add( v ) );
                }
            }

            return settings.ToSelectionString();
        }
开发者ID:SparkDevNetwork,项目名称:Rock,代码行数:40,代码来源:GroupMemberAttributesFilter.cs

示例3: GetSelection

        /// <summary>
        /// Gets the selection.
        /// Implement this version of GetSelection if your DataFilterComponent works the same in all FilterModes
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="controls">The collection of controls used to set the filter values.</param>
        /// <returns>
        /// A formatted string.
        /// </returns>
        public override string GetSelection( Type entityType, Control[] controls )
        {
            var ddlDataView = controls.GetByName<DataViewPicker>( _CtlDataView );
            var ddlLocationType = controls.GetByName<RockDropDownList>( _CtlLocationType );

            var settings = new FilterSettings();

            settings.LocationTypeGuid = ddlLocationType.SelectedValue.AsGuidOrNull();
            settings.DataViewGuid = DataComponentSettingsHelper.GetDataViewGuid( ddlDataView.SelectedValue );

            return settings.ToSelectionString();
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:21,代码来源:LocationDataViewFilter.cs

示例4: GetSelection

        /// <summary>
        /// Gets the selection.
        /// Implement this version of GetSelection if your DataFilterComponent works the same in all FilterModes
        /// </summary>
        /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param>
        /// <param name="controls">The collection of controls used to set the filter values.</param>
        /// <returns>
        /// A formatted string.
        /// </returns>
        public override string GetSelection( Type entityType, Control[] controls )
        {
            var ddlDataView = controls.GetByName<DataViewPicker>( _CtlDataView );

            var settings = new FilterSettings();

            settings.DataViewGuid = DataComponentSettingsHelper.GetDataViewGuid( ddlDataView.SelectedValue );

            return settings.ToSelectionString();
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:19,代码来源:GroupTypeDataViewFilter.cs


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