本文整理汇总了C#中FilterDescriptor.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# FilterDescriptor.ToString方法的具体用法?C# FilterDescriptor.ToString怎么用?C# FilterDescriptor.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilterDescriptor
的用法示例。
在下文中一共展示了FilterDescriptor.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToString_TwoPartCompoundExpression_CreatesValidString
public void ToString_TwoPartCompoundExpression_CreatesValidString()
{
var filter = new FilterDescriptor(
LogicalOperators.Or,
new MobileObservableCollection<IFilterDescriptor>
{
new FilterDescriptor("FirstName", FilterOperator.StartsWith, "a"),
new FilterDescriptor("LastName", FilterOperator.Contains, "ba"),
});
Assert.AreEqual("(FirstName StartsWith {a}) OR (LastName Contains {ba})", filter.ToString());
}
示例2: ToString_NestedCompoundExpression_CreatesValidString
public void ToString_NestedCompoundExpression_CreatesValidString()
{
var filter = new FilterDescriptor(
LogicalOperators.Or,
new MobileObservableCollection<IFilterDescriptor>
{
new FilterDescriptor("FirstName", FilterOperator.StartsWith, "a"),
new FilterDescriptor(
LogicalOperators.And,
new MobileObservableCollection<IFilterDescriptor>
{
new FilterDescriptor("LastName", FilterOperator.Contains, "ba"),
new FilterDescriptor("Salary", FilterOperator.IsLessThan, "2000"),
})
});
Assert.AreEqual("(FirstName StartsWith {a}) OR ((LastName Contains {ba}) AND (Salary IsLessThan {2000}))", filter.ToString());
}
示例3: ToString_SimpleExpression_CreatesValidString
public void ToString_SimpleExpression_CreatesValidString()
{
var filter = new FilterDescriptor("FirstName", FilterOperator.StartsWith, "a");
Assert.AreEqual("FirstName StartsWith {a}", filter.ToString());
}
示例4: EmptyStringValue_ShouldByEncodedAsBrackets
public void EmptyStringValue_ShouldByEncodedAsBrackets()
{
var filter = new FilterDescriptor("FirstName", FilterOperator.StartsWith, string.Empty);
Assert.AreEqual("FirstName StartsWith {}", filter.ToString());
}