Example #1
0
        internal static void TryGetExistingHoldDurationInStore(IExchangePrincipal exchangePrincipal, string clientString, out Unlimited <EnhancedTimeSpan> existingHoldDuration, out ElcMailboxHelper.ConfigState state, out Exception exception)
        {
            Func <string, KeyValuePair <Unlimited <EnhancedTimeSpan>, ElcMailboxHelper.ConfigState> > valueFunction = delegate(string value)
            {
                Unlimited <EnhancedTimeSpan> key = default(Unlimited <EnhancedTimeSpan>);
                ElcMailboxHelper.ConfigState value2;
                double value3;
                if (string.Compare(value, Globals.UnlimitedHoldDuration, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    key    = Unlimited <EnhancedTimeSpan> .UnlimitedValue;
                    value2 = ElcMailboxHelper.ConfigState.Found;
                }
                else if (double.TryParse(value.ToString(), out value3))
                {
                    EnhancedTimeSpan fromValue = EnhancedTimeSpan.FromMilliseconds(value3);
                    key    = fromValue;
                    value2 = ElcMailboxHelper.ConfigState.Found;
                }
                else
                {
                    value2 = ElcMailboxHelper.ConfigState.Corrupt;
                }
                return(new KeyValuePair <Unlimited <EnhancedTimeSpan>, ElcMailboxHelper.ConfigState>(key, value2));
            };

            ElcMailboxHelper.TryGetExistingValueInStore <Unlimited <EnhancedTimeSpan> >(exchangePrincipal, clientString, "LitigationHoldDuration", valueFunction, out existingHoldDuration, out state, out exception);
        }