protected virtual void NotifyParentChange(GridEntry ge) { while (((ge != null) && (ge is PropertyDescriptorGridEntry)) && ((PropertyDescriptorGridEntry)ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { object valueOwner = ge.GetValueOwner(); bool isValueType = valueOwner.GetType().IsValueType; while ((!(ge is PropertyDescriptorGridEntry) || isValueType) ? valueOwner.Equals(ge.GetValueOwner()) : (valueOwner == ge.GetValueOwner())) { ge = ge.ParentGridEntry; if (ge == null) { break; } } if (ge != null) { valueOwner = ge.GetValueOwner(); IComponentChangeService componentChangeService = this.ComponentChangeService; if (componentChangeService != null) { componentChangeService.OnComponentChanging(valueOwner, ((PropertyDescriptorGridEntry)ge).propertyInfo); componentChangeService.OnComponentChanged(valueOwner, ((PropertyDescriptorGridEntry)ge).propertyInfo, null, null); } ge.ClearCachedValues(false); PropertyGridView gridEntryHost = this.GridEntryHost; if (gridEntryHost != null) { gridEntryHost.InvalidateGridEntryValue(ge); } } } }
protected virtual void NotifyParentChange(GridEntry ge) { // now see if we need to notify the parent(s) up the chain while (ge != null && ge is PropertyDescriptorGridEntry && ((PropertyDescriptorGridEntry)ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { // find the next parent property with a differnet value owner object owner = ge.GetValueOwner(); // find the next property descriptor with a different parent while (!(ge is PropertyDescriptorGridEntry) || owner == ge.GetValueOwner()) { ge = ge.ParentGridEntry; if (ge == null) { break; } } // fire the change on that owner if (ge != null) { owner = ge.GetValueOwner(); IComponentChangeService changeService = ComponentChangeService; if (changeService != null) { changeService.OnComponentChanging(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo); changeService.OnComponentChanged(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo, null, null); } } } }
protected override void NotifyParentsOfChanges(GridEntry entry) { // Now see if we need to notify the parent(s) up the chain. while (entry is PropertyDescriptorGridEntry propertyEntry && propertyEntry.PropertyDescriptor.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { // Find the next parent property with a different value owner. object owner = entry.GetValueOwner(); // Find the next property descriptor with a different parent. while (entry is not PropertyDescriptorGridEntry || OwnersEqual(owner, entry.GetValueOwner())) { entry = entry.ParentGridEntry; if (entry is null) { break; } } // Fire the change on the owner. if (entry is null) { continue; } owner = entry.GetValueOwner(); IComponentChangeService changeService = ComponentChangeService; if (changeService is null) { continue; } if (owner is Array ownerArray) { for (int i = 0; i < ownerArray.Length; i++) { PropertyDescriptor propertyInfo = propertyEntry.PropertyDescriptor; if (propertyInfo is MergePropertyDescriptor descriptor) { propertyInfo = descriptor[i]; } if (propertyInfo is not null) { changeService.OnComponentChanging(ownerArray.GetValue(i), propertyInfo); changeService.OnComponentChanged(ownerArray.GetValue(i), propertyInfo); } } } else { changeService.OnComponentChanging(owner, propertyEntry.PropertyDescriptor); changeService.OnComponentChanged(owner, propertyEntry.PropertyDescriptor); } } }
protected override void NotifyParentChange(GridEntry ge) { // now see if we need to notify the parent(s) up the chain while (ge != null && ge is PropertyDescriptorGridEntry && ((PropertyDescriptorGridEntry)ge)._propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { // find the next parent property with a differnet value owner object owner = ge.GetValueOwner(); // find the next property descriptor with a different parent while (!(ge is PropertyDescriptorGridEntry) || OwnersEqual(owner, ge.GetValueOwner())) { ge = ge.ParentGridEntry; if (ge is null) { break; } } // fire the change on that owner if (ge != null) { owner = ge.GetValueOwner(); IComponentChangeService changeService = ComponentChangeService; if (changeService != null) { if (owner is Array ownerArray) { for (int i = 0; i < ownerArray.Length; i++) { PropertyDescriptor pd = ((PropertyDescriptorGridEntry)ge)._propertyInfo; ; if (pd is MergePropertyDescriptor) { pd = ((MergePropertyDescriptor)pd)[i]; } if (pd != null) { changeService.OnComponentChanging(ownerArray.GetValue(i), pd); changeService.OnComponentChanged(ownerArray.GetValue(i), pd, null, null); } } } else { changeService.OnComponentChanging(owner, ((PropertyDescriptorGridEntry)ge)._propertyInfo); changeService.OnComponentChanged(owner, ((PropertyDescriptorGridEntry)ge)._propertyInfo, null, null); } } } } }
protected virtual void NotifyParentChange(GridEntry ge) { // now see if we need to notify the parent(s) up the chain while (ge != null && ge is PropertyDescriptorGridEntry && ((PropertyDescriptorGridEntry)ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { // find the next parent property with a differnet value owner object owner = ge.GetValueOwner(); // Fix for Dev10 bug 584323: // when owner is an instance of a value type, // we can't just use == in the following while condition testing bool isValueType = owner.GetType().IsValueType; // find the next property descriptor with a different parent while (!(ge is PropertyDescriptorGridEntry) || isValueType ? owner.Equals(ge.GetValueOwner()) : owner == ge.GetValueOwner()) { ge = ge.ParentGridEntry; if (ge == null) { break; } } // fire the change on that owner if (ge != null) { owner = ge.GetValueOwner(); IComponentChangeService changeService = ComponentChangeService; if (changeService != null) { changeService.OnComponentChanging(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo); changeService.OnComponentChanged(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo, null, null); } ge.ClearCachedValues(false); //clear the value so it paints correctly next time. PropertyGridView gv = this.GridEntryHost; if (gv != null) { gv.InvalidateGridEntryValue(ge); } } } }
protected override void NotifyParentChange(GridEntry ge) { while (((ge != null) && (ge is PropertyDescriptorGridEntry)) && ((PropertyDescriptorGridEntry)ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { object valueOwner = ge.GetValueOwner(); while (!(ge is PropertyDescriptorGridEntry) || this.OwnersEqual(valueOwner, ge.GetValueOwner())) { ge = ge.ParentGridEntry; if (ge == null) { break; } } if (ge != null) { valueOwner = ge.GetValueOwner(); IComponentChangeService componentChangeService = this.ComponentChangeService; if (componentChangeService == null) { continue; } Array array = valueOwner as Array; if (array != null) { for (int i = 0; i < array.Length; i++) { PropertyDescriptor propertyInfo = ((PropertyDescriptorGridEntry)ge).propertyInfo; if (propertyInfo is MergePropertyDescriptor) { propertyInfo = ((MergePropertyDescriptor)propertyInfo)[i]; } if (propertyInfo != null) { componentChangeService.OnComponentChanging(array.GetValue(i), propertyInfo); componentChangeService.OnComponentChanged(array.GetValue(i), propertyInfo, null, null); } } continue; } componentChangeService.OnComponentChanging(valueOwner, ((PropertyDescriptorGridEntry)ge).propertyInfo); componentChangeService.OnComponentChanged(valueOwner, ((PropertyDescriptorGridEntry)ge).propertyInfo, null, null); } } }
protected virtual void NotifyParentChange(GridEntry ge) { while (((ge != null) && (ge is PropertyDescriptorGridEntry)) && ((PropertyDescriptorGridEntry) ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { object valueOwner = ge.GetValueOwner(); bool isValueType = valueOwner.GetType().IsValueType; while ((!(ge is PropertyDescriptorGridEntry) || isValueType) ? valueOwner.Equals(ge.GetValueOwner()) : (valueOwner == ge.GetValueOwner())) { ge = ge.ParentGridEntry; if (ge == null) { break; } } if (ge != null) { valueOwner = ge.GetValueOwner(); IComponentChangeService componentChangeService = this.ComponentChangeService; if (componentChangeService != null) { componentChangeService.OnComponentChanging(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo); componentChangeService.OnComponentChanged(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo, null, null); } ge.ClearCachedValues(false); PropertyGridView gridEntryHost = this.GridEntryHost; if (gridEntryHost != null) { gridEntryHost.InvalidateGridEntryValue(ge); } } } }
/// <include file='doc\GridEntry.uex' path='docs/doc[@for="GridEntry.NotifyChildValue"]/*' /> /// <devdoc> /// Sends a notify message to the child GridEntry, and returns the success result /// </devdoc> internal virtual bool NotifyChildValue(GridEntry pe, int type) { return pe.NotifyValueGivenParent(pe.GetValueOwner(),type); }
protected override void NotifyParentChange(GridEntry ge) { // now see if we need to notify the parent(s) up the chain while (ge != null && ge is PropertyDescriptorGridEntry && ((PropertyDescriptorGridEntry)ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { // find the next parent property with a differnet value owner object owner = ge.GetValueOwner(); // find the next property descriptor with a different parent while (!(ge is PropertyDescriptorGridEntry) || OwnersEqual(owner, ge.GetValueOwner())) { ge = ge.ParentGridEntry; if (ge == null) { break; } } // fire the change on that owner if (ge != null) { owner = ge.GetValueOwner(); IComponentChangeService changeService = ComponentChangeService; if (changeService != null) { Array ownerArray = owner as Array; if (ownerArray != null) { for (int i = 0; i < ownerArray.Length; i++) { PropertyDescriptor pd = ((PropertyDescriptorGridEntry)ge).propertyInfo;; if (pd is MergePropertyDescriptor) { pd = ((MergePropertyDescriptor)pd)[i]; } if (pd != null) { changeService.OnComponentChanging(ownerArray.GetValue(i), pd); changeService.OnComponentChanged(ownerArray.GetValue(i), pd, null, null); } } } else { changeService.OnComponentChanging(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo); changeService.OnComponentChanged(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo, null, null); } } } } }
protected override void NotifyParentChange(GridEntry ge) { while (((ge != null) && (ge is PropertyDescriptorGridEntry)) && ((PropertyDescriptorGridEntry) ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) { object valueOwner = ge.GetValueOwner(); while (!(ge is PropertyDescriptorGridEntry) || this.OwnersEqual(valueOwner, ge.GetValueOwner())) { ge = ge.ParentGridEntry; if (ge == null) { break; } } if (ge != null) { valueOwner = ge.GetValueOwner(); IComponentChangeService componentChangeService = this.ComponentChangeService; if (componentChangeService == null) { continue; } Array array = valueOwner as Array; if (array != null) { for (int i = 0; i < array.Length; i++) { PropertyDescriptor propertyInfo = ((PropertyDescriptorGridEntry) ge).propertyInfo; if (propertyInfo is MergePropertyDescriptor) { propertyInfo = ((MergePropertyDescriptor) propertyInfo)[i]; } if (propertyInfo != null) { componentChangeService.OnComponentChanging(array.GetValue(i), propertyInfo); componentChangeService.OnComponentChanged(array.GetValue(i), propertyInfo, null, null); } } continue; } componentChangeService.OnComponentChanging(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo); componentChangeService.OnComponentChanged(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo, null, null); } } }