예제 #1
0
 private AcrProfile(AcrProfile[] baseProfiles, AcrPropertyResolver genericResolver)
 {
     if (baseProfiles != null)
     {
         foreach (AcrProfile acrProfile in baseProfiles)
         {
             int num = 0;
             foreach (AcrProfile acrProfile2 in baseProfiles)
             {
                 if (acrProfile == acrProfile2)
                 {
                     num++;
                 }
                 else
                 {
                     foreach (PropertyDefinition key in acrProfile.propertyProfileCollection.Keys)
                     {
                         if (acrProfile2.propertyProfileCollection.ContainsKey(key))
                         {
                             throw new ArgumentException(ServerStrings.ExInvalidAcrBaseProfiles);
                         }
                     }
                 }
             }
             if (num != 1)
             {
                 throw new ArgumentException(ServerStrings.ExInvalidAcrBaseProfiles);
             }
         }
     }
     this.baseProfiles    = baseProfiles;
     this.genericResolver = genericResolver;
 }
예제 #2
0
 internal AcrPropertyProfile(AcrPropertyResolver resolver, bool requireChangeTracking, PropertyDefinition[] propertiesToResolve)
 {
     this.resolver = resolver;
     this.requireChangeTracking = requireChangeTracking;
     this.propertiesToResolve   = (propertiesToResolve ?? Array <PropertyDefinition> .Empty);
     this.allProperties         = Util.MergeArrays <PropertyDefinition>(new ICollection <PropertyDefinition>[]
     {
         propertiesToResolve,
         resolver.Dependencies
     });
 }
예제 #3
0
 internal static AcrProfile CreateWithGenericResolver(AcrPropertyResolver resolver, params AcrProfile[] baseProfiles)
 {
     return(new AcrProfile(baseProfiles, resolver));
 }
예제 #4
0
 private static void ResolveConflicts(Dictionary <PropertyDefinition, PropertyConflict> conflicts, AcrPropertyResolver resolver, Dictionary <PropertyDefinition, AcrPropertyProfile.ValuesToResolve> propertyValuesToResolve, PropertyDefinition[] propertiesToResolve)
 {
     AcrPropertyProfile.ValuesToResolve[] array        = AcrProfile.FilterValuesToResolve(propertyValuesToResolve, propertiesToResolve);
     AcrPropertyProfile.ValuesToResolve[] dependencies = AcrProfile.FilterValuesToResolve(propertyValuesToResolve, resolver.Dependencies);
     object[] array2 = resolver.Resolve(array, dependencies);
     for (int i = 0; i < propertiesToResolve.Length; i++)
     {
         PropertyConflict value = new PropertyConflict(propertiesToResolve[i], array[i].OriginalValue, array[i].ClientValue, array[i].ServerValue, (array2 != null) ? array2[i] : null, array2 != null);
         conflicts.Add(propertiesToResolve[i], value);
     }
 }