本文整理汇总了C#中IQueryable.CreateEqualExpression方法的典型用法代码示例。如果您正苦于以下问题:C# IQueryable.CreateEqualExpression方法的具体用法?C# IQueryable.CreateEqualExpression怎么用?C# IQueryable.CreateEqualExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQueryable
的用法示例。
在下文中一共展示了IQueryable.CreateEqualExpression方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToLinqExpression
public override Expression ToLinqExpression( IQueryable queryable, ParameterExpression parameterExpression, string propertyName )
{
if( queryable == null )
throw new ArgumentNullException( "queryable" );
if( parameterExpression == null )
throw new ArgumentNullException( "parameterExpression" );
if( String.IsNullOrEmpty( propertyName ) )
{
if( propertyName == null )
throw new ArgumentNullException( "propertyName" );
throw new ArgumentException( "PropertyName must not be empty.", "propertyName" );
}
return queryable.CreateEqualExpression( parameterExpression, propertyName, this.Value );
}
示例2: FilterQueryable
private IQueryable FilterQueryable( IQueryable queryable )
{
// Filters a queryable to match this Group's clause.
// This method does not apply the AutoFilter clauses or the FilterRow clauses.
// It is the DataGridVirtualizingQueryableCollectionViewGroupRoot's job to do so on the
// base queryable used as a base for all other queryables.
if( queryable == null )
throw new ArgumentNullException( "queryable" );
int level = this.Level;
DataGridVirtualizingCollectionViewBase collectionView = this.GetCollectionView();
ObservableCollection<GroupDescription> groupDescriptions = collectionView.GroupDescriptions;
Debug.Assert( ( groupDescriptions != null ) && ( level < groupDescriptions.Count ) );
DataGridGroupDescription groupBy = groupDescriptions[ level ] as DataGridGroupDescription;
Debug.Assert( groupBy != null );
ParameterExpression sharedParameterExpression = queryable.CreateParameterExpression();
Expression expression = queryable.CreateEqualExpression( sharedParameterExpression, groupBy.PropertyName, this.Name );
return queryable.WhereFilter( sharedParameterExpression, expression );
}
示例3: GetAutoFilterValuesExpression
private Expression GetAutoFilterValuesExpression( IQueryable queryable, ParameterExpression sharedParameterExpression )
{
if( queryable == null )
throw new ArgumentNullException( "queryable" );
AutoFilterMode autoFilterMode = m_parentCollectionView.AutoFilterMode;
if( autoFilterMode == AutoFilterMode.None )
return null;
DataGridItemPropertyCollection itemProperties = m_parentCollectionView.ItemProperties;
int itemPropertiesCount = itemProperties.Count;
Expression autoFilterValuesExpression = null;
for( int i = 0; i < itemPropertiesCount; i++ )
{
DataGridItemPropertyBase itemProperty = itemProperties[ i ];
string itemPropertyName = itemProperty.Name;
IList itemPropertyAutoFilterValues;
if( m_parentCollectionView.AutoFilterValues.TryGetValue( itemPropertyName, out itemPropertyAutoFilterValues ) )
{
int itemPropertyAutoFilterValuesCount = itemPropertyAutoFilterValues.Count;
if( itemPropertyAutoFilterValuesCount == 0 )
continue;
object[] itemPropertyAutoFilterValuesArray = new object[ itemPropertyAutoFilterValuesCount ];
itemPropertyAutoFilterValues.CopyTo( itemPropertyAutoFilterValuesArray, 0 );
Expression itemPropertyAutoFilterExpression = queryable.CreateEqualExpression( sharedParameterExpression, itemPropertyName, itemPropertyAutoFilterValuesArray );
if( autoFilterValuesExpression == null )
{
autoFilterValuesExpression = itemPropertyAutoFilterExpression;
}
else
{
Debug.Assert( ( autoFilterMode == AutoFilterMode.And ) || ( autoFilterMode == AutoFilterMode.Or ) );
// Merge this DataGridItemProperty AutoFilterExpressions
if( autoFilterMode == AutoFilterMode.And )
{
autoFilterValuesExpression = Expression.And( autoFilterValuesExpression, itemPropertyAutoFilterExpression );
}
else
{
autoFilterValuesExpression = Expression.Or( autoFilterValuesExpression, itemPropertyAutoFilterExpression );
}
}
}
// Loop to next DataGridItemProperty.
}
return autoFilterValuesExpression;
}
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:59,代码来源:DataGridVirtualizingQueryableCollectionViewGroupRoot.cs