Пример #1
0
        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);
            }
        }
Пример #2
0
        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;
                }
            }
        }
Пример #3
0
        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();
            }
        }
Пример #4
0
        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;
                }
            }
        }
Пример #5
0
 void IDataDescriptorPeer.OnAssociatedDescriptorRemoved(DataDescriptor descriptor)
 {
     this.OnAssociatedDescriptorRemoved(descriptor);
 }
Пример #6
0
 void IDataDescriptorPeer.OnAssociatedDescriptorPropertyChanged(DataDescriptor descriptor, string propertyName)
 {
     this.OnAssociatedDescriptorPropertyChanged(descriptor, propertyName);
 }
Пример #7
0
 void IDataDescriptorPeer.OnDescriptorAssociated(DataDescriptor descriptor)
 {
     this.OnDescriptorAssociated(descriptor);
 }
Пример #8
0
 private void AddDescriptor(DataDescriptor descriptor, int index)
 {
     descriptor.PropertyChanged += this.OnItemPropertyChanged;
     descriptor.Attach(this.owner);
     this.AddDescription(descriptor, index);
 }
Пример #9
0
 private void RemoveDescriptor(DataDescriptor descriptor)
 {
     descriptor.PropertyChanged -= this.OnItemPropertyChanged;
     descriptor.Detach();
     this.RemoveDescription(descriptor);
 }