Example #1
0
        private static object[] ResolveBasedOnCompare <T>(Predicate <int> comparisonInterpreter, IList <AcrPropertyProfile.ValuesToResolve> valuesToResolve, IList <AcrPropertyProfile.ValuesToResolve> dependencies) where T : IComparable <T>
        {
            AcrPropertyProfile.ValuesToResolve valuesToResolve2 = valuesToResolve[0];
            bool flag;

            if (AcrHelpers.MatchPropertyValues(valuesToResolve2.ClientValue, valuesToResolve2.ServerValue))
            {
                flag = comparisonInterpreter(0);
            }
            else if (!(valuesToResolve2.ServerValue is T))
            {
                flag = comparisonInterpreter(1);
            }
            else if (!(valuesToResolve2.ClientValue is T))
            {
                flag = comparisonInterpreter(-1);
            }
            else
            {
                T t = (T)((object)valuesToResolve2.ClientValue);
                flag = comparisonInterpreter(t.CompareTo((T)((object)valuesToResolve2.ServerValue)));
            }
            return(new object[]
            {
                flag?valuesToResolve2.ClientValue : valuesToResolve2.ServerValue
            });
        }
Example #2
0
        internal static object[] ResolveToModifiedValue(IList <AcrPropertyProfile.ValuesToResolve> valuesToResolve, IList <AcrPropertyProfile.ValuesToResolve> dependencies)
        {
            if (valuesToResolve[0].OriginalValue == null)
            {
                return(null);
            }
            bool flag  = !AcrHelpers.MatchPropertyValues(valuesToResolve[0].ClientValue, valuesToResolve[0].OriginalValue);
            bool flag2 = !AcrHelpers.MatchPropertyValues(valuesToResolve[0].ServerValue, valuesToResolve[0].OriginalValue);

            if (flag && !flag2)
            {
                return(new object[]
                {
                    valuesToResolve[0].ClientValue
                });
            }
            if (!flag)
            {
                return(new object[]
                {
                    valuesToResolve[0].ServerValue
                });
            }
            return(null);
        }
Example #3
0
 internal static object[] ResolveToIncrementHighestIntValue(IList <AcrPropertyProfile.ValuesToResolve> valuesToResolve, IList <AcrPropertyProfile.ValuesToResolve> dependencies)
 {
     object[] array = AcrHelpers.ResolveToHighestIntValue(valuesToResolve, dependencies);
     if (array.Length > 0 && array[0] is int)
     {
         int num = (int)array[0];
         array[0] = num + 1;
     }
     return(array);
 }
Example #4
0
 internal static object[] ResolveToServerValueIfClientMatchesServer(IList <AcrPropertyProfile.ValuesToResolve> valuesToResolve, IList <AcrPropertyProfile.ValuesToResolve> dependencies)
 {
     if (AcrHelpers.MatchPropertyValues(valuesToResolve[0].ServerValue, valuesToResolve[0].ClientValue))
     {
         return(new object[]
         {
             valuesToResolve[0].ServerValue
         });
     }
     return(null);
 }
Example #5
0
 internal static object[] ResolveToHighestValue <T>(IList <AcrPropertyProfile.ValuesToResolve> valuesToResolve, IList <AcrPropertyProfile.ValuesToResolve> dependencies) where T : IComparable <T>
 {
     return(AcrHelpers.ResolveBasedOnCompare <T>((int sign) => sign > 0, valuesToResolve, dependencies));
 }