private static void PropagateChange(NameGenerator parentGenerator, DomainPropertyInfo propertyInfo, object oldValue, object newValue) { foreach (NameGenerator refinement in parentGenerator.RefinedByGeneratorCollection) { if (propertyInfo.GetValue(refinement).Equals(oldValue)) { propertyInfo.SetValue(refinement, newValue); PropagateChange(refinement, propertyInfo, oldValue, newValue); } } }
private static void PropagateChange(NameGenerator parentGenerator, DomainPropertyInfo propertyInfo, object oldValue, object newValue, Type nameUsageType) { foreach (NameGenerator refinement in parentGenerator.RefinedByGeneratorCollection) { Type refinementUsage = refinement.NameUsageType; if (refinementUsage == null) { // Make sure we skip the level to get the corresponding usages PropagateChange(refinement, propertyInfo, oldValue, newValue, nameUsageType); } else if (refinementUsage == nameUsageType && propertyInfo.GetValue(refinement).Equals(oldValue)) { propertyInfo.SetValue(refinement, newValue); PropagateChange(refinement, propertyInfo, oldValue, newValue, nameUsageType); } } }