private void AddDescription(DataDescriptor newItem, int index) { if (this.descriptionCollection == null) { return; } if (index >= 0) { this.descriptionCollection.Insert(index, newItem.EngineDescription); } else { this.descriptionCollection.Add(newItem.EngineDescription); } }
private void RemoveDescription(DataDescriptor oldItem) { if (this.descriptionCollection == null) { return; } foreach (DescriptionBase description in this.descriptionCollection) { if (oldItem.Equals(description)) { this.descriptionCollection.Remove(description); break; } } }
internal virtual void OnAssociatedDescriptorRemoved(DataDescriptor descriptor) { if (this.Model == null) { return; } if (descriptor is FilterDescriptorBase) { this.isFiltered = this.Model.FilterDescriptors.Where(d => d.DescriptorPeer == this).FirstOrDefault() != descriptor; this.UpdateFilterVisualState(this.isFiltered); } else if (!this.updatingSort && descriptor == this.currentSortDescriptor) { this.ClearSort(); } }
internal virtual void OnDescriptorAssociated(DataDescriptor descriptor) { if (descriptor is FilterDescriptorBase) { this.isFiltered = true; this.UpdateFilterVisualState(this.isFiltered); } else if (descriptor != this.currentSortDescriptor) { var sortDescriptor = descriptor as SortDescriptorBase; if (sortDescriptor != null) { this.currentSortDescriptor = sortDescriptor; this.SortDirection = this.currentSortDescriptor.SortOrder == SortOrder.Ascending ? SortDirection.Ascending : SortDirection.Descending; } } }
void IDataDescriptorPeer.OnAssociatedDescriptorRemoved(DataDescriptor descriptor) { this.OnAssociatedDescriptorRemoved(descriptor); }
void IDataDescriptorPeer.OnAssociatedDescriptorPropertyChanged(DataDescriptor descriptor, string propertyName) { this.OnAssociatedDescriptorPropertyChanged(descriptor, propertyName); }
void IDataDescriptorPeer.OnDescriptorAssociated(DataDescriptor descriptor) { this.OnDescriptorAssociated(descriptor); }
private void AddDescriptor(DataDescriptor descriptor, int index) { descriptor.PropertyChanged += this.OnItemPropertyChanged; descriptor.Attach(this.owner); this.AddDescription(descriptor, index); }
private void RemoveDescriptor(DataDescriptor descriptor) { descriptor.PropertyChanged -= this.OnItemPropertyChanged; descriptor.Detach(); this.RemoveDescription(descriptor); }