// This method returns the StatFunction properties as defined by the "parent" // DataGridCollectionView as well as the other "standard" properties for this class. // The StatFunction properties are NOT filtered by the specified attributes. PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) { if (attributes == null) { // We only cache the full property list. if (m_classProperties == null) { DataGridCollectionView view = this.GetCollectionView(); Debug.Assert(view != null, "A group should always have a parent CollectionView for the StatFunctions to work."); if (view == null) { return(TypeDescriptor.GetProperties(typeof(DataGridCollectionViewGroup))); } PropertyDescriptorCollection classProperties = TypeDescriptor.GetProperties(typeof(DataGridCollectionViewGroup)); PropertyDescriptorCollection statProperties = view.GetStatFunctionProperties(); PropertyDescriptor[] properties = new PropertyDescriptor[classProperties.Count + statProperties.Count]; classProperties.CopyTo(properties, 0); statProperties.CopyTo(properties, classProperties.Count); m_classProperties = new PropertyDescriptorCollection(properties); } return(m_classProperties); } else { PropertyDescriptorCollection props = TypeDescriptor.GetProperties(this, attributes); DataGridCollectionView view = this.GetCollectionView(); if (view != null) { foreach (PropertyDescriptor property in view.GetStatFunctionProperties()) { props.Add(property); } } return(props); } }
internal void InvokeStatFunctionsPropertyChanged(DataGridCollectionView view) { if (view.CalculateChangedPropertyStatsOnly) { foreach (Stats.StatFunction statFunction in view.InvalidatedStatFunctions) { { this.OnPropertyChanged(new PropertyChangedEventArgs(statFunction.ResultPropertyName)); } } } else { foreach (PropertyDescriptor statFunctionPropertyDescriptor in view.GetStatFunctionProperties()) { this.OnPropertyChanged(new PropertyChangedEventArgs(statFunctionPropertyDescriptor.Name)); } } }
internal void InvokeStatFunctionsPropertyChanged(DataGridCollectionView collectionView) { if (this.HasPropertyChangedListeners) { if (collectionView.CalculateChangedPropertyStatsOnly && !this.CalculateAllStats) { foreach (StatFunction statFunction in collectionView.InvalidatedStatFunctions) { { this.OnPropertyChanged(new PropertyChangedEventArgs(statFunction.ResultPropertyName)); } } } else { foreach (PropertyDescriptor statFunctionPropertyDescriptor in collectionView.GetStatFunctionProperties()) { this.OnPropertyChanged(new PropertyChangedEventArgs(statFunctionPropertyDescriptor.Name)); } } } this.CalculateAllStats = false; }
internal void InvokeStatFunctionsPropertyChanged( DataGridCollectionView view ) { if( view.CalculateChangedPropertyStatsOnly ) { foreach( Stats.StatFunction statFunction in view.InvalidatedStatFunctions ) { { this.OnPropertyChanged( new PropertyChangedEventArgs( statFunction.ResultPropertyName ) ); } } } else { foreach( PropertyDescriptor statFunctionPropertyDescriptor in view.GetStatFunctionProperties() ) { this.OnPropertyChanged( new PropertyChangedEventArgs( statFunctionPropertyDescriptor.Name ) ); } } }