本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}