private void Clear() { FilterRequestedContext filterContext = new FilterRequestedContext(); filterContext.IsFiltering = false; filterContext.Descriptor = this.owner.Context.AssociatedDescriptor; filterContext.Column = this.owner.Context.Column; this.owner.Owner.CommandService.ExecuteCommand(CommandId.FilterRequested, filterContext); this.owner.Close(); }
private void Filter() { if (this.owner.Context.AssociatedDescriptor != null) { this.owner.Owner.FilterDescriptors.Remove(this.owner.Context.AssociatedDescriptor); } FilterDescriptorBase result; if (this.owner.IsExpanded) { CompositeFilterDescriptor compositeDescriptor = new CompositeFilterDescriptor(); compositeDescriptor.Operator = (LogicalOperator)this.owner.OperatorCombo.SelectedIndex; var firstDescriptor = this.owner.FirstFilterControl.BuildDescriptor(); var secondDescriptor = this.owner.SecondFilterControl == null ? null : this.owner.SecondFilterControl.BuildDescriptor(); if (firstDescriptor != null) { compositeDescriptor.Descriptors.Add(firstDescriptor); } if (secondDescriptor != null) { compositeDescriptor.Descriptors.Add(secondDescriptor); } result = compositeDescriptor; } else { result = this.owner.FirstFilterControl.BuildDescriptor(); } FilterRequestedContext filterContext = new FilterRequestedContext(); filterContext.Descriptor = result; filterContext.Column = this.owner.Context.Column; filterContext.IsFiltering = true; this.owner.Owner.CommandService.ExecuteCommand(CommandId.FilterRequested, filterContext); this.owner.Close(); }