private static void CopyPropertyFromStorage(PropertyInfo property, object propertyValue, PolicyConfigurationBase baseConfiguration) { if (UnifiedPolicyStorageFactory.IsIncrementalAttribute(property)) { IncrementalAttributeBase incrementalAttribute = UnifiedPolicyStorageFactory.GetIncrementalAttribute(property, true, propertyValue); property.GetSetMethod().Invoke(baseConfiguration, new IncrementalAttributeBase[] { incrementalAttribute }); return; } property.GetSetMethod().Invoke(baseConfiguration, new object[] { propertyValue }); }
private static void InitializeIncrementalAttributes(PolicyConfigurationBase baseConfiguration, IEnumerable <PropertyInfo> allProperties) { foreach (PropertyInfo propertyInfo in from p in allProperties where UnifiedPolicyStorageFactory.IsIncrementalAttribute(p) select p) { IncrementalAttributeBase incrementalAttribute = UnifiedPolicyStorageFactory.GetIncrementalAttribute(propertyInfo, false, null); propertyInfo.GetSetMethod().Invoke(baseConfiguration, new IncrementalAttributeBase[] { incrementalAttribute }); } foreach (PropertyInfo propertyInfo2 in from p in allProperties where UnifiedPolicyStorageFactory.IsIncrementalCollection(p) select p) { IncrementalAttributeBase incrementalCollection = UnifiedPolicyStorageFactory.GetIncrementalCollection(propertyInfo2, false, null, null); propertyInfo2.GetSetMethod().Invoke(baseConfiguration, new IncrementalAttributeBase[] { incrementalCollection }); } }