private IAdvancedBindingListView GetAdvancedBindingListView() { if (base.List == null) { return(null); } IAdvancedBindingListView advancedBindingListView = base.List as IAdvancedBindingListView; if (advancedBindingListView == null) { throw new NotSupportedException("IAdvancedBindingListView are required"); } return(advancedBindingListView); }
private void AdvancedBindingSource_DataSourceChanged(object sender, EventArgs e) { IAdvancedBindingListView advancedBindingListView = this.GetAdvancedBindingListView(); if (advancedBindingListView != this.currentList) { if (this.currentList != null) { this.currentList.FilteringChanged -= this.CurrentList_FilteringChanged; } this.currentList = advancedBindingListView; if (this.currentList != null) { this.currentList.FilteringChanged += this.CurrentList_FilteringChanged; } } }