Example #1
0
 internal AcrProfile(AcrPropertyResolverChain.ResolutionFunction genericResolutionFunction, params AcrProfile[] baseProfiles) : this(baseProfiles, new AcrPropertyResolverChain(new AcrPropertyResolverChain.ResolutionFunction[]
 {
     genericResolutionFunction,
     new AcrPropertyResolverChain.ResolutionFunction(AcrHelpers.ResolveToServerValueIfClientMatchesServer)
 }, null, true))
 {
 }
Example #2
0
        private void AddPropertyProfile(AcrPropertyResolverChain.ResolutionFunction resolutionFunction, bool requireChangeTracking, params StorePropertyDefinition[] interDependentProperties)
        {
            for (int i = 0; i < interDependentProperties.Length; i++)
            {
                PropertyDefinition propertyDefinition = interDependentProperties[i];
                if (propertyDefinition is SmartPropertyDefinition)
                {
                    throw new ArgumentException("interndependentProperties cannot contain SmartProperties");
                }
                if (this.propertyProfileCollection.ContainsKey(propertyDefinition) || i < Array.LastIndexOf <PropertyDefinition>(interDependentProperties, propertyDefinition))
                {
                    throw new ArgumentException(ServerStrings.ExPropertyDefinitionInMoreThanOnePropertyProfile);
                }
            }
            AcrPropertyProfile value = new AcrPropertyProfile(new AcrPropertyResolverChain(new AcrPropertyResolverChain.ResolutionFunction[]
            {
                resolutionFunction
            }, null, false), requireChangeTracking, interDependentProperties);

            foreach (StorePropertyDefinition key in interDependentProperties)
            {
                this.propertyProfileCollection.Add(key, value);
            }
        }