本文整理汇总了C#中FilterDescriptor类的典型用法代码示例。如果您正苦于以下问题:C# FilterDescriptor类的具体用法?C# FilterDescriptor怎么用?C# FilterDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterDescriptor类属于命名空间,在下文中一共展示了FilterDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectInvoicesVm
public SelectInvoicesVm(SelectInvoices selectInvoicesWindow, IPaymentService service)
: base(service)
{
SelectInvoicesWindow = selectInvoicesWindow;
CommitCommand = new DelegateCommand<object>(OnCommitExecute, CanCommitExecute);
CancelCommand = new DelegateCommand<object>(OnCancelExecute, CanCancelExecute);
Suppliers = new QueryableDataServiceCollectionView<SupplierDTO>(service.Context, service.Context.Suppliers);
Currencies = new QueryableDataServiceCollectionView<CurrencyDTO>(service.Context, service.Context.Currencies);
_supplierFilter = new FilterDescriptor("SupplierId", FilterOperator.IsEqualTo, 0);
#region 发票
Invoices = new QueryableDataServiceCollectionView<BaseInvoiceDTO>(service.Context, service.Context.Invoices);
Invoices.FilterDescriptors.Add(_supplierFilter);
Invoices.LoadedData += (e, o) =>
{
InvoiceList = new ObservableCollection<BaseInvoiceDTO>();
Invoices.ToList().ForEach(InvoiceList.Add);
SelectInvoices = new ObservableCollection<BaseInvoiceDTO>();
if (!InvoiceList.Any()) return;
_paymentNotice.PaymentNoticeLines.ToList().ForEach(p =>
{
if (InvoiceList.Any(t => t.InvoiceId == p.InvoiceId))
SelectInvoices.Add(InvoiceList.FirstOrDefault(t => t.InvoiceId == p.InvoiceId));
});
};
#endregion
}
示例2: fillDonorsCombo
private void fillDonorsCombo()
{
Operation.BeginOperation(this);
this.Invoke((MethodInvoker)delegate
{
this.DonorsColumnComboBox.MultiColumnComboBoxElement.DropDownWidth = 500;
this.DonorsColumnComboBox.AutoFilter = true;
this.DonorsColumnComboBox.ValueMember = "ID";
this.DonorsColumnComboBox.DisplayMember = "Name";
});
var q = TheDonorCmd.GetAllDonors();
this.Invoke((MethodInvoker)delegate
{
DonorsColumnComboBox.DataSource = q;
FilterDescriptor filter = new FilterDescriptor();
filter.PropertyName = this.DonorsColumnComboBox.DisplayMember;
filter.Operator = FilterOperator.Contains;
this.DonorsColumnComboBox.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
});
Operation.EndOperation(this);
th.Abort();
}
示例3: FillEmployeeCombo
private void FillEmployeeCombo()
{
Operation.BeginOperation(this);
this.Invoke((MethodInvoker)delegate
{
this.EmployeeComboBox.MultiColumnComboBoxElement.DropDownWidth = 500;
this.EmployeeComboBox.AutoFilter = true;
this.EmployeeComboBox.ValueMember = "ID";
this.EmployeeComboBox.DisplayMember = "EmployeeName";
});
var q = EmployeeCmd.GetAll();
this.Invoke((MethodInvoker)delegate
{
EmployeeComboBox.DataSource = q;
this.EmployeeComboBox.AutoFilter = true;
CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor();
FilterDescriptor empname = new FilterDescriptor("EmployeeName", FilterOperator.Contains, "");
FilterDescriptor empNumber = new FilterDescriptor("EmployeejobNumber", FilterOperator.Contains, "");
compositeFilter.FilterDescriptors.Add(empname);
compositeFilter.FilterDescriptors.Add(empNumber);
compositeFilter.LogicalOperator = FilterLogicalOperator.Or;
this.EmployeeComboBox.EditorControl.FilterDescriptors.Add(compositeFilter);
});
Operation.EndOperation(this);
th.Abort();
}
示例4: CreateFilterForColumn
private IFilterDescriptor CreateFilterForColumn(GridViewDataColumn column)
{
FilterOperator filterOperator = GetFilterOperatorForType(column.DataType);
FilterDescriptor descriptor = new FilterDescriptor(column.UniqueName, filterOperator, this.filterValue);
descriptor.MemberType = column.DataType;
return descriptor;
}
示例5: settingfactorGridFilter
private void settingfactorGridFilter()
{
FilterDescriptor filter = new FilterDescriptor();
filter.PropertyName = "projname";
filter.Operator = FilterOperator.IsEqualTo;
filter.Value = null ;
filter.IsFilterEditor = true;
this.factorslist.FilterDescriptors.Add(filter);
}
示例6: CreateMiddlewareInstance
private IMiddlewarePlugin CreateMiddlewareInstance(string filterType)
{
var type = TypeHelper<Type>.GetTypeByFullName(filterType);
var typeFilterAttribute = new TypeFilterAttribute(type) { Order = 0 };
var filterDescriptor = new FilterDescriptor(typeFilterAttribute, 0);
var instance = _serviceProvider.GetService(type);
var iMiddlewarePlugin = (IMiddlewarePlugin)instance;
return iMiddlewarePlugin;
}
示例7: RadGridView1_SelectionChanged
private void RadGridView1_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
{
AccountsdataServiceDataSource.FilterDescriptors.Remove(AccountsDetailsFilter);
RadGridView Grid = (RadGridView)sender;
RadControlsSilverlightClient.TDocs.AccountTypes a = (RadControlsSilverlightClient.TDocs.AccountTypes)Grid.SelectedItem;
if (a != null)
{
AccountsDetailsFilter = new FilterDescriptor("typeID_fk", FilterOperator.IsEqualTo, a.accounttypeID_pk);
AccountsdataServiceDataSource.FilterDescriptors.Add(AccountsDetailsFilter);
}
}
示例8: StringificationTakesConvertersIntoAccount
public void StringificationTakesConvertersIntoAccount()
{
var query = new FilterDescriptor<MyObject>().Term(t => t.MyEnum, MyEnum.Foo);
var serialized = _serializationClient.Serializer.Serialize(query).Utf8String();
serialized.JsonEquals(@"
{
""term"" : {
""myEnum"" : ""Foo""
}
}").Should().BeTrue();
}
示例9: ListDocumentsVm
public ListDocumentsVm(ICommonService service)
: base(service)
{
_service = service;
_context = service.Context;
InitializeVM();
_filter = new FilterDescriptor<DocumentDTO> {FilteringExpression = e => true};
Documents.FilterDescriptors.Add(_filter);
}
示例10: 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());
}
示例11: ConstructorWithParamsTest
public void ConstructorWithParamsTest()
{
const FilterOperator Fo = FilterOperator.Any;
var myValue = new object();
var item = new FilterDescriptor("igogo", Fo, myValue);
Assert.AreEqual("igogo", item.ColumnName);
Assert.AreEqual(Fo, item.Operator);
Assert.AreEqual(myValue, item.Value);
}
示例12: showdone_ToggleStateChanged
private void showdone_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args)
{
this.marketGrid.FilterDescriptors.Remove("done");
if (!showdone.Checked)
{
FilterDescriptor filter = new FilterDescriptor();
filter.PropertyName = "done";
filter.Operator = FilterOperator.IsEqualTo;
filter.Value = showdone.Checked;
filter.IsFilterEditor = true;
this.marketGrid.FilterDescriptors.Add(filter);
}
}
示例13: RadGridView1_SelectionChanged
private void RadGridView1_SelectionChanged(object sender, SelectionChangeEventArgs e)
{
dataServiceDataSource.FilterDescriptors.Remove(DetailsFilter);
RadGridView Grid = (RadGridView)sender;
RadControlsSilverlightClient.TDocs.SignersView a = (RadControlsSilverlightClient.TDocs.SignersView)Grid.SelectedItem;
if (a != null)
{
DetailsFilter = new FilterDescriptor("signerID_pk", FilterOperator.IsEqualTo, a.signerID_pk);
dataServiceDataSource.FilterDescriptors.Add(DetailsFilter);
signersDataForm.CurrentItem = dataServiceDataSource.DataView.CurrentItem;
}
}
示例14: AccountsView_SelectionChanged
public void AccountsView_SelectionChanged(object sender, SelectionChangeEventArgs e)
{
RadWindow window = new RadWindow();
TDocs.BADSInfo selectedItem = AccountsView.SelectedItem as TDocs.BADSInfo;
FilterDescriptor fd = new FilterDescriptor("accountNumber", FilterOperator.IsEqualTo, selectedItem.accountNumber);
entitlementsDataSource.FilterDescriptors.Add(fd);
window.Content = new BADSSheet(selectedItem);
window.Header = "Account Data Sheet";
window.Height = 620;
window.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen;
window.ShowDialog();
entitlementsDataSource.FilterDescriptors.Remove(fd);
}
示例15: RadGridView1_SelectionChanged
private void RadGridView1_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
{
ContactsdataServiceDataSource.FilterDescriptors.Remove(BankContactsDetailsFilter);
AccountsdataServiceDataSource.FilterDescriptors.Remove(BankAccountsDetailsFilter);
RadGridView Grid = (RadGridView)sender;
RadControlsSilverlightClient.TDocs.Banks b = (RadControlsSilverlightClient.TDocs.Banks)Grid.SelectedItem;
if (b != null)
{
BankContactsDetailsFilter = new FilterDescriptor("bankID_fk", FilterOperator.IsEqualTo, b.bankID_pk);
ContactsdataServiceDataSource.FilterDescriptors.Add(BankContactsDetailsFilter);
BankAccountsDetailsFilter = new FilterDescriptor("bankID_fk", FilterOperator.IsEqualTo, b.bankID_pk);
AccountsdataServiceDataSource.FilterDescriptors.Add(BankAccountsDetailsFilter);
}
}