internal static void TryGetEHAHiddenFolderCleanupWatermarkInStore(IExchangePrincipal exchangePrincipal, string clientString, out ElcMailboxHelper.ConfigState state, out Exception exception) { Func <string, KeyValuePair <string, ElcMailboxHelper.ConfigState> > valueFunction = delegate(string value) { ElcMailboxHelper.ConfigState value2; if (!string.IsNullOrEmpty(value)) { if (!value.Equals("EHAHiddenFolderCleanupWatermark")) { value2 = ElcMailboxHelper.ConfigState.Invalid; } else { value2 = ElcMailboxHelper.ConfigState.Found; } } else { value2 = ElcMailboxHelper.ConfigState.Empty; } return(new KeyValuePair <string, ElcMailboxHelper.ConfigState>(value, value2)); }; string text = null; ElcMailboxHelper.TryGetExistingValueInStore <string>(exchangePrincipal, clientString, "EHAHiddenFolderCleanupWatermark", valueFunction, out text, out state, out exception); }
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); }
internal static void TryGetHoldCleanupWatermarkInStore(IExchangePrincipal exchangePrincipal, string clientString, out DefaultFolderType folderType, out string internetMessageId, out ElcMailboxHelper.ConfigState state, out Exception exception) { folderType = DefaultFolderType.None; internetMessageId = null; Func <string, KeyValuePair <string, ElcMailboxHelper.ConfigState> > valueFunction = delegate(string value) { ElcMailboxHelper.ConfigState value2; if (!string.IsNullOrEmpty(value)) { value2 = ElcMailboxHelper.ConfigState.Found; } else { value2 = ElcMailboxHelper.ConfigState.Empty; } return(new KeyValuePair <string, ElcMailboxHelper.ConfigState>(value, value2)); }; string text = null; ElcMailboxHelper.TryGetExistingValueInStore <string>(exchangePrincipal, clientString, "HoldCleanupWatermark", valueFunction, out text, out state, out exception); if (state == ElcMailboxHelper.ConfigState.Found) { string[] array = text.Split(new char[] { ':' }, 2); try { folderType = (DefaultFolderType)Enum.Parse(typeof(DefaultFolderType), array[0]); if (array.Length == 2) { internetMessageId = array[1]; } } catch (ArgumentException) { state = ElcMailboxHelper.ConfigState.Corrupt; } } }