private void AddFromProperties(IEnumerable <PropertyInfo> properties, String accessType, ISet <String> persistentProperties)
        {
            //ORIG: foreach (XProperty property in properties) {
            foreach (PropertyInfo property in properties)
            {
                // If this is not a persistent property, with the same access type as currently checked,
                // it's not audited as well.
                if (persistentProperties.Contains(property.Name))
                {
                    IValue propertyValue = _persistentPropertiesSource.GetProperty(property.Name).Value;

                    PropertyAuditingData propertyData;
                    bool isAudited;
                    if (propertyValue is Component)
                    {
                        ComponentAuditingData componentData = new ComponentAuditingData();
                        isAudited = FillPropertyData(property, componentData, accessType);

                        IPersistentPropertiesSource componentPropertiesSource = new ComponentPropertiesSource(
                            (Component)propertyValue);
                        new AuditedPropertiesReader(ModificationStore.FULL, componentPropertiesSource, componentData,
                                                    _globalCfg,
                                                    _propertyNamePrefix + MappingTools.createComponentPrefix(property.Name))
                        .read();

                        propertyData = componentData;
                    }
                    else
                    {
                        propertyData = new PropertyAuditingData();
                        isAudited    = FillPropertyData(property, propertyData, accessType);
                    }

                    if (isAudited)
                    {
                        // Now we know that the property is audited
                        _auditedPropertiesHolder.addPropertyAuditingData(property.Name, propertyData);
                    }
                }
            }
        }
        public IList <PersistentCollectionChangeData> MapCollectionChanges(String referencingPropertyName,
                                                                           IPersistentCollection newColl,
                                                                           object oldColl,
                                                                           object id)
        {
            // Name of the property, to which we will delegate the mapping.
            String delegatePropertyName;

            // Checking if the property name doesn't reference a collection in a component - then the name will containa a .
            int dotIndex = referencingPropertyName.IndexOf('.');

            if (dotIndex != -1)
            {
                // Computing the name of the component
                String componentName = referencingPropertyName.Substring(0, dotIndex);
                // And the name of the property in the component
                String propertyInComponentName = MappingTools.createComponentPrefix(componentName)
                                                 + referencingPropertyName.Substring(dotIndex + 1);

                // We need to get the mapper for the component.
                referencingPropertyName = componentName;
                // As this is a component, we delegate to the property in the component.
                delegatePropertyName = propertyInComponentName;
            }
            else
            {
                // If this is not a component, we delegate to the same property.
                delegatePropertyName = referencingPropertyName;
            }

            IPropertyMapper mapper = Properties[propertyDatas[referencingPropertyName]];

            if (mapper != null)
            {
                return(mapper.MapCollectionChanges(delegatePropertyName, newColl, oldColl, id));
            }
            else
            {
                return(null);
            }
        }