バージョン

LogicalOperator 列挙体

複数条件を統合するのに使用される論理演算子を指定する列挙体。
シンタックス
'宣言
 
Public Enum LogicalOperator 
   Inherits System.Enum
public enum LogicalOperator : System.Enum 
メンバ
メンバ解説
And'And' 論理演算子。正しく一致させるためには、すべての条件をパスする必要があります。
Or'Or' 論理演算子。正しく一致させるためには、少なくとも 1 つの条件をパスする必要があります。
解説

LogicalOperator 列挙型は、複数条件の評価結果を統合するのに使用される ConditionGroupConditionGroup.LogicalOperator を指定するのに使用されます。

使用例
The following code adds a RecordFilter for 'Percent' field. The record filter is populated with two conditions. The 'Conditions' property of the RecordFilter is of ConditionGroup type, which has a 'LogicalOperator' property that specifies whether to combine the conditions in the group using 'Or' or 'And' logical operation. The following code snippet sets the LogicalOperator to 'Or'.
Imports Infragistics.Windows
Imports Infragistics.Windows.Controls
Imports Infragistics.Windows.Editors
Imports Infragistics.Windows.DataPresenter
Imports Infragistics.Windows.DataPresenter.Events

    Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        
        Dim fieldLayout As FieldLayout = _dp.FieldLayouts(0)

        ' Create a filter that shows 'Percent' field where the values are less than 0
        ' or greater than 100.
        Dim filter As RecordFilter = New RecordFilter()
        filter.FieldName = "Percent"
        filter.Conditions.Add(New ComparisonCondition(ComparisonOperator.LessThan, 0))
        filter.Conditions.Add(New ComparisonCondition(ComparisonOperator.GreaterThan, 100))

        ' By default the LogicalOperator is 'And'. Since we want to 'Or' the above two
        ' conditions, set the LogicalOperator on the condition group to 'Or'.
        filter.Conditions.LogicalOperator = LogicalOperator.Or

        ' Apply the filter to the data presenter.
        fieldLayout.RecordFilters.Add(filter)

    End Sub
The following code adds a RecordFilter for 'Percent' field. The record filter is populated with two conditions. The 'Conditions' property of the RecordFilter is of ConditionGroup type, which has a 'LogicalOperator' property that specifies whether to combine the conditions in the group using 'Or' or 'And' logical operation. The following code snippet sets the LogicalOperator to 'Or'.
using Infragistics.Windows;
using Infragistics.Windows.Controls;
using Infragistics.Windows.Editors;
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;

		public void Window1_Loaded( object sender, RoutedEventArgs e )
		{
			FieldLayout fieldLayout = _dp.FieldLayouts[0];

			// Create a filter that shows 'Percent' field where the values are less than 0
			// or greater than 100.
			RecordFilter filter = new RecordFilter( );
			filter.FieldName = "Percent";
			filter.Conditions.Add( new ComparisonCondition( ComparisonOperator.LessThan, 0 ) );
			filter.Conditions.Add( new ComparisonCondition( ComparisonOperator.GreaterThan, 100 ) );

			// By default the LogicalOperator is 'And'. Since we want to 'Or' the above two
			// conditions, set the LogicalOperator on the condition group to 'Or'.
			filter.Conditions.LogicalOperator = LogicalOperator.Or;

			// Apply the filter to the data presenter.
			fieldLayout.RecordFilters.Add( filter );
		}
The following code snippet adds a ConditionGroup with two conditions to the RecordFilter of 'Percent' field. The LogicalOperator on the condition group is set to 'Or' to combine the conditions using 'Or' instead of the default 'And' logical operation.
        <igDP:XamDataGrid x:Name="_dp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >

            
<igDP:XamDataGrid.FieldLayouts>
                
                
<igDP:FieldLayout IsDefault="true">

                    
<igDP:FieldLayout.RecordFilters>
                        
<igDP:RecordFilter FieldName="Percent">
                            
<!--Add a condition group with two conditions. By default the conditions will be
                            combined using 'And' logical operator. Set LogicalOperator to 'Or' to combine the
                            conditions in the group using 'Or' logical operator.
-->
                            
<igWindows:ConditionGroup LogicalOperator="Or">
                                
<igWindows:ComparisonCondition Operator="LessThan" Value="0" />
                                
<igWindows:ComparisonCondition Operator="GreaterThan" Value="100" />
                            
</igWindows:ConditionGroup>
                        
</igDP:RecordFilter>
                    
</igDP:FieldLayout.RecordFilters>
                    
                
</igDP:FieldLayout>
                
            
</igDP:XamDataGrid.FieldLayouts>
            
        
</igDP:XamDataGrid>
参照