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 CopyPropertyToStorage(PropertyDefinition schemaProperty, PropertyInfo property, IPropertyBag storage, PolicyConfigurationBase baseConfiguration) { object obj = property.GetGetMethod().Invoke(baseConfiguration, null); if (UnifiedPolicyStorageFactory.IsIncrementalAttribute(property) || UnifiedPolicyStorageFactory.IsIncrementalCollection(property)) { IncrementalAttributeBase incrementalAttributeBase = (IncrementalAttributeBase)obj; if (incrementalAttributeBase != null && incrementalAttributeBase.Changed) { UnifiedPolicyStorageFactory.StoreValue(storage, schemaProperty, incrementalAttributeBase.GetObjectValue()); return; } } else { UnifiedPolicyStorageFactory.StoreValue(storage, schemaProperty, obj); } }
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 }); } }