private bool GetOutOfOfficeMessage(int traceId, MailboxSession session, MailTips mailTips) { bool flag = false; MailTipsLocalQuery.GetMailTipsTracer.TraceFunction <object, EmailAddress>((long)traceId, "{0} / {1}: Getting OutOfOffice", TraceContext.Get(), mailTips.EmailAddress); Stopwatch stopwatch = Stopwatch.StartNew(); try { object obj = session.Mailbox.TryGetProperty(MailboxSchema.MailboxOofState); bool flag2 = true; if (!(obj is PropertyError)) { flag2 = (bool)obj; } if (flag2) { UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(session); this.ParseUserOofSettings(userOofSettings, mailTips, traceId); } flag = true; } catch (InvalidParameterException ex) { MailTipsLocalQuery.GetMailTipsTracer.TraceDebug((long)traceId, "{0} / {1}: GetOofMailTip InvalidParameterException: {2}, {3}", new object[] { TraceContext.Get(), mailTips.EmailAddress, ex.GetType().Name, ex.Message }); mailTips.OutOfOfficeMessage = null; flag = true; } finally { stopwatch.Stop(); MailTipsPerfCounters.OutOfOfficeAnsweredWithinOneSecond_Base.Increment(); if (stopwatch.ElapsedMilliseconds < 1000L) { MailTipsPerfCounters.OutOfOfficeAnsweredWithinOneSecond.Increment(); MailTipsPerfCounters.OutOfOfficeAnsweredWithinThreeSeconds.Increment(); MailTipsPerfCounters.OutOfOfficeAnsweredWithinTenSeconds.Increment(); } else if (stopwatch.ElapsedMilliseconds < 3000L) { MailTipsPerfCounters.OutOfOfficeAnsweredWithinThreeSeconds.Increment(); MailTipsPerfCounters.OutOfOfficeAnsweredWithinTenSeconds.Increment(); } else if (stopwatch.ElapsedMilliseconds < 10000L) { MailTipsPerfCounters.OutOfOfficeAnsweredWithinTenSeconds.Increment(); } if (flag) { MailTipsPerfCounters.OutOfOfficePositiveResponses.Increment(); } } return(flag); }
protected void CreateOutOfOfficeNotification() { this.shouldShowOofDialog = ((base.UserContext.MailboxSession.Mailbox.TryGetProperty(MailboxSchema.MailboxOofState) as bool?) ?? false); if (!this.shouldShowOofDialog || base.UserContext.IsWebPartRequest) { return; } UserOofSettings userOofSettings = null; try { userOofSettings = UserOofSettings.GetUserOofSettings(base.UserContext.MailboxSession); } catch (QuotaExceededException ex) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "BasicMessageView.CreateOutOfOfficeNotification: Failed. Exception: {0}", ex.Message); return; } switch (userOofSettings.OofState) { case OofState.Enabled: this.shouldShowOofDialog = base.UserContext.MessageViewFirstRender; break; case OofState.Scheduled: { this.shouldShowOofDialog = false; if (RenderingFlags.HideOutOfOfficeInfoBar(base.UserContext)) { return; } DateTime utcNow = DateTime.UtcNow; DateTime t = DateTime.MinValue; DateTime t2 = DateTime.MinValue; if (userOofSettings.Duration != null) { t = userOofSettings.Duration.StartTime; t2 = userOofSettings.Duration.EndTime; } if (utcNow > t && t2 > utcNow) { ExDateTime exDateTime = new ExDateTime(base.UserContext.TimeZone, userOofSettings.Duration.EndTime); SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder = new SanitizingStringBuilder <OwaHtml>(); sanitizingStringBuilder.AppendFormat(LocalizedStrings.GetHtmlEncoded(-1261886615), new object[] { exDateTime.ToLongDateString() + " " + exDateTime.ToString(base.UserContext.UserOptions.TimeFormat) }); sanitizingStringBuilder.Append(" <a href=# onclick=\"onClkHdOof()\">"); sanitizingStringBuilder.Append(LocalizedStrings.GetNonEncoded(1303059585)); sanitizingStringBuilder.Append("</a>"); base.Infobar.AddMessageHtml(sanitizingStringBuilder.ToSanitizedString <SanitizedHtmlString>(), InfobarMessageType.Informational); } return; } default: this.shouldShowOofDialog = false; return; } }
public void DisableOof() { ExTraceGlobals.UserOptionsCallTracer.TraceDebug((long)this.GetHashCode(), "OptionsEventHandler.DisableOof"); UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(base.UserContext.MailboxSession); userOofSettings.OofState = OofState.Disabled; userOofSettings.Save(base.UserContext.MailboxSession); }
// Token: 0x06001BCB RID: 7115 RVA: 0x0006B1A4 File Offset: 0x000693A4 protected override bool InternalExecute() { MailboxSession mailboxIdentityMailboxSession = base.CallContext.SessionCache.GetMailboxIdentityMailboxSession(); UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(mailboxIdentityMailboxSession); userOofSettings.OofState = (this.userOofSettings.IsOofOn ? OofState.Enabled : OofState.Disabled); userOofSettings.ExternalAudience = this.userOofSettings.ExternalAudience; userOofSettings.InternalReply.Message = UserOofSettingsType.ConvertTextToHtml(this.userOofSettings.InternalReply); userOofSettings.ExternalReply.Message = UserOofSettingsType.ConvertTextToHtml(this.userOofSettings.ExternalReply); userOofSettings.Save(mailboxIdentityMailboxSession); return true; }
protected override void InternalSave(ConfigurableObject instance) { MailboxAutoReplyConfiguration mailboxAutoReplyConfiguration = (MailboxAutoReplyConfiguration)instance; UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(base.MailboxSession); if (userOofSettings == null) { userOofSettings = UserOofSettings.CreateDefault(); } if (mailboxAutoReplyConfiguration.IsModified(MailboxAutoReplyConfigurationSchema.AutoReplyState)) { userOofSettings.OofState = mailboxAutoReplyConfiguration.AutoReplyState; } if (mailboxAutoReplyConfiguration.IsModified(MailboxAutoReplyConfigurationSchema.ExternalAudience)) { userOofSettings.ExternalAudience = mailboxAutoReplyConfiguration.ExternalAudience; } if (mailboxAutoReplyConfiguration.IsModified(MailboxAutoReplyConfigurationSchema.ExternalMessage)) { userOofSettings.ExternalReply.Message = mailboxAutoReplyConfiguration.ExternalMessage; userOofSettings.ExternalReply.LanguageTag = Thread.CurrentThread.CurrentCulture.Name; } if (mailboxAutoReplyConfiguration.IsModified(MailboxAutoReplyConfigurationSchema.InternalMessage)) { userOofSettings.InternalReply.Message = mailboxAutoReplyConfiguration.InternalMessage; userOofSettings.InternalReply.LanguageTag = Thread.CurrentThread.CurrentCulture.Name; } if (mailboxAutoReplyConfiguration.IsModified(MailboxAutoReplyConfigurationSchema.StartTime)) { userOofSettings.Duration.StartTime = mailboxAutoReplyConfiguration.StartTime.ToUniversalTime(); } if (mailboxAutoReplyConfiguration.IsModified(MailboxAutoReplyConfigurationSchema.EndTime)) { userOofSettings.Duration.EndTime = mailboxAutoReplyConfiguration.EndTime.ToUniversalTime(); } try { userOofSettings.Save(base.MailboxSession); } catch (ObjectExistedException) { userOofSettings.Save(base.MailboxSession); } }
protected override IEnumerable <T> InternalFindPaged <T>(QueryFilter filter, ObjectId rootId, bool deepSearch, SortBy sortBy, int pageSize) { if (filter != null && !(filter is FalseFilter)) { throw new NotSupportedException("filter"); } if (rootId != null && rootId is ADObjectId && !ADObjectId.Equals((ADObjectId)rootId, base.MailboxSession.MailboxOwner.ObjectId)) { throw new NotSupportedException("rootId"); } if (!typeof(MailboxAutoReplyConfiguration).IsAssignableFrom(typeof(T))) { throw new NotSupportedException("FindPaged: " + typeof(T).FullName); } MailboxAutoReplyConfiguration configObject = (MailboxAutoReplyConfiguration)((object)((default(T) == null) ? Activator.CreateInstance <T>() : default(T))); configObject.MailboxOwnerId = base.MailboxSession.MailboxOwner.ObjectId; UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(base.MailboxSession); if (userOofSettings == null) { userOofSettings = UserOofSettings.CreateDefault(); } configObject.AutoReplyState = userOofSettings.OofState; configObject.ExternalAudience = userOofSettings.ExternalAudience; configObject.ExternalMessage = userOofSettings.ExternalReply.Message; configObject.InternalMessage = userOofSettings.InternalReply.Message; if (userOofSettings.Duration != null) { configObject.StartTime = userOofSettings.Duration.StartTime.ToLocalTime(); configObject.EndTime = userOofSettings.Duration.EndTime.ToLocalTime(); } yield return((T)((object)configObject)); yield break; }
// Token: 0x06001B12 RID: 6930 RVA: 0x00066B68 File Offset: 0x00064D68 public static UserOofSettingsType GetSetting(MailboxSession mailboxSession, ExTimeZone timeZone) { UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(mailboxSession); return(new UserOofSettingsType(userOofSettings, timeZone)); }
// Token: 0x06000D76 RID: 3446 RVA: 0x0004A270 File Offset: 0x00048470 private void ProcessSet(XmlNode setNode) { using (Command.CurrentCommand.Context.Tracker.Start(TimeId.OOFSettingsProcessSet)) { AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Processing Oof - Set"); UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(this.mailboxSession); bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; foreach (object obj in setNode.ChildNodes) { XmlNode xmlNode = (XmlNode)obj; if (this.status != SettingsBase.ErrorCode.Success) { break; } string localName; if ((localName = xmlNode.LocalName) != null) { if (localName == "OofState") { string innerText = xmlNode.InnerText; string a; if ((a = innerText) != null) { if (a == "0") { userOofSettings.OofState = OofState.Disabled; continue; } if (a == "1") { userOofSettings.OofState = OofState.Enabled; continue; } if (a == "2") { userOofSettings.OofState = OofState.Scheduled; continue; } } this.status = SettingsBase.ErrorCode.ProtocolError; continue; } if (localName == "StartTime") { string innerText2 = xmlNode.InnerText; if (userOofSettings.Duration == null) { userOofSettings.Duration = new Duration((DateTime)ExDateTime.UtcNow, (DateTime)ExDateTime.UtcNow); } userOofSettings.Duration.StartTime = this.DecodeDateTime(innerText2); flag = true; continue; } if (localName == "EndTime") { string innerText3 = xmlNode.InnerText; if (userOofSettings.Duration == null) { userOofSettings.Duration = new Duration((DateTime)ExDateTime.UtcNow, (DateTime)ExDateTime.UtcNow); } userOofSettings.Duration.EndTime = this.DecodeDateTime(innerText3); flag2 = true; continue; } if (localName == "OofMessage") { OofSetting.OofMessage oofMessage; oofMessage.Enabled = false; oofMessage.ReplyMessage = null; oofMessage.BodyType = null; oofMessage.AppliesToInternal = false; oofMessage.AppliesToExternalKnown = false; oofMessage.AppliesToExternalUnknown = false; foreach (object obj2 in xmlNode.ChildNodes) { XmlNode xmlNode2 = (XmlNode)obj2; if (this.status != SettingsBase.ErrorCode.Success) { break; } string localName2; switch (localName2 = xmlNode2.LocalName) { case "AppliesToInternal": if (flag3) { this.status = SettingsBase.ErrorCode.ConflictingArguments; continue; } flag3 = true; oofMessage.AppliesToInternal = true; continue; case "AppliesToExternalKnown": if (flag4) { this.status = SettingsBase.ErrorCode.ConflictingArguments; continue; } oofMessage.AppliesToExternalKnown = true; continue; case "AppliesToExternalUnknown": if (flag6) { this.status = SettingsBase.ErrorCode.ConflictingArguments; continue; } oofMessage.AppliesToExternalUnknown = true; continue; case "Enabled": if (xmlNode2.InnerText.Equals("1", StringComparison.OrdinalIgnoreCase)) { oofMessage.Enabled = true; continue; } continue; case "ReplyMessage": oofMessage.ReplyMessage = xmlNode2.InnerText; continue; case "BodyType": oofMessage.BodyType = xmlNode2.InnerText; continue; } this.status = SettingsBase.ErrorCode.ProtocolError; } if (this.status != SettingsBase.ErrorCode.Success) { continue; } if (oofMessage.ReplyMessage != null) { if (oofMessage.BodyType == null) { this.status = SettingsBase.ErrorCode.ProtocolError; continue; } if (oofMessage.BodyType.Equals("TEXT", StringComparison.OrdinalIgnoreCase)) { oofMessage.ReplyMessage = OofSetting.InternalTextToHtml(oofMessage.ReplyMessage); oofMessage.BodyType = "HTML"; } if (!oofMessage.BodyType.Equals("HTML", StringComparison.OrdinalIgnoreCase)) { this.status = SettingsBase.ErrorCode.InvalidArguments; continue; } } if (oofMessage.AppliesToInternal) { if (oofMessage.Enabled) { userOofSettings.InternalReply.Message = oofMessage.ReplyMessage; } else { userOofSettings.InternalReply.Message = string.Empty; } } if (oofMessage.AppliesToExternalKnown && oofMessage.AppliesToExternalUnknown) { if (flag4 || flag6) { this.status = SettingsBase.ErrorCode.ConflictingArguments; continue; } if (oofMessage.Enabled) { userOofSettings.ExternalReply.Message = oofMessage.ReplyMessage; userOofSettings.ExternalAudience = ExternalAudience.All; flag5 = true; flag7 = true; flag4 = true; flag6 = true; continue; } userOofSettings.ExternalReply.Message = string.Empty; userOofSettings.ExternalAudience = ExternalAudience.None; flag4 = true; flag6 = true; continue; } else if (oofMessage.AppliesToExternalKnown) { if (oofMessage.Enabled) { if (flag6) { if (!string.Equals(oofMessage.ReplyMessage, userOofSettings.ExternalReply.Message, StringComparison.Ordinal)) { this.status = SettingsBase.ErrorCode.ConflictingArguments; continue; } userOofSettings.ExternalAudience = ExternalAudience.All; } else { userOofSettings.ExternalReply.Message = oofMessage.ReplyMessage; userOofSettings.ExternalAudience = ExternalAudience.Known; } flag5 = true; flag4 = true; continue; } if (flag6 && flag7) { this.status = SettingsBase.ErrorCode.ConflictingArguments; continue; } userOofSettings.ExternalAudience = ExternalAudience.None; flag4 = true; continue; } else { if (!oofMessage.AppliesToExternalUnknown) { continue; } if (oofMessage.Enabled) { if (flag4) { if (!string.Equals(oofMessage.ReplyMessage, userOofSettings.ExternalReply.Message, StringComparison.Ordinal)) { this.status = SettingsBase.ErrorCode.ConflictingArguments; continue; } userOofSettings.ExternalAudience = ExternalAudience.All; } else { userOofSettings.ExternalReply.Message = oofMessage.ReplyMessage; userOofSettings.ExternalAudience = ExternalAudience.All; } flag7 = true; flag6 = true; continue; } if (flag4 && flag5) { userOofSettings.ExternalAudience = ExternalAudience.Known; } else { userOofSettings.ExternalAudience = ExternalAudience.None; } flag6 = true; continue; } } } this.status = SettingsBase.ErrorCode.ProtocolError; } if (this.status == SettingsBase.ErrorCode.Success && (flag ^ flag2)) { this.status = SettingsBase.ErrorCode.ProtocolError; } if (this.status == SettingsBase.ErrorCode.Success && userOofSettings.OofState == OofState.Scheduled && (userOofSettings.Duration == null || userOofSettings.Duration.EndTime <= userOofSettings.Duration.StartTime || userOofSettings.Duration.EndTime <= DateTime.UtcNow)) { this.status = SettingsBase.ErrorCode.ConflictingArguments; } if (this.status == SettingsBase.ErrorCode.Success) { userOofSettings.Save(this.mailboxSession); AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Done processing Oof - Set."); } } }
// Token: 0x06000D75 RID: 3445 RVA: 0x00049D24 File Offset: 0x00047F24 private void ProcessGet(XmlNode getNode) { using (Command.CurrentCommand.Context.Tracker.Start(TimeId.OOFSettingsProcessGet)) { AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Processing Oof - Get"); XmlNode firstChild = getNode.FirstChild; string innerText = firstChild.InnerText; bool flag; if (string.Equals(innerText, "html", StringComparison.OrdinalIgnoreCase)) { flag = true; } else { if (!string.Equals(innerText, "text", StringComparison.OrdinalIgnoreCase)) { this.status = SettingsBase.ErrorCode.ProtocolError; return; } flag = false; } XmlNode xmlNode = base.Response.OwnerDocument.CreateElement("Get", "Settings:"); XmlNode xmlNode2 = base.Response.OwnerDocument.CreateElement("OofState", "Settings:"); XmlNode xmlNode3 = base.Response.OwnerDocument.CreateElement("StartTime", "Settings:"); XmlNode xmlNode4 = base.Response.OwnerDocument.CreateElement("EndTime", "Settings:"); XmlNode xmlNode5 = base.Response.OwnerDocument.CreateElement("OofMessage", "Settings:"); XmlNode newChild = base.Response.OwnerDocument.CreateElement("AppliesToInternal", "Settings:"); XmlNode xmlNode6 = base.Response.OwnerDocument.CreateElement("ReplyMessage", "Settings:"); XmlNode xmlNode7 = base.Response.OwnerDocument.CreateElement("Enabled", "Settings:"); XmlNode xmlNode8 = base.Response.OwnerDocument.CreateElement("BodyType", "Settings:"); XmlNode xmlNode9 = base.Response.OwnerDocument.CreateElement("OofMessage", "Settings:"); XmlNode newChild2 = base.Response.OwnerDocument.CreateElement("AppliesToExternalKnown", "Settings:"); XmlNode xmlNode10 = base.Response.OwnerDocument.CreateElement("ReplyMessage", "Settings:"); XmlNode xmlNode11 = base.Response.OwnerDocument.CreateElement("Enabled", "Settings:"); XmlNode xmlNode12 = base.Response.OwnerDocument.CreateElement("BodyType", "Settings:"); XmlNode xmlNode13 = base.Response.OwnerDocument.CreateElement("OofMessage", "Settings:"); XmlNode newChild3 = base.Response.OwnerDocument.CreateElement("AppliesToExternalUnknown", "Settings:"); XmlNode xmlNode14 = base.Response.OwnerDocument.CreateElement("ReplyMessage", "Settings:"); XmlNode xmlNode15 = base.Response.OwnerDocument.CreateElement("Enabled", "Settings:"); XmlNode xmlNode16 = base.Response.OwnerDocument.CreateElement("BodyType", "Settings:"); UserOofSettings userOofSettings = UserOofSettings.GetUserOofSettings(this.mailboxSession); xmlNode.AppendChild(xmlNode2); xmlNode2.InnerText = ((int)userOofSettings.OofState).ToString(CultureInfo.InvariantCulture); if (userOofSettings.Duration != null && !userOofSettings.SetByLegacyClient) { xmlNode.AppendChild(xmlNode3); xmlNode.AppendChild(xmlNode4); xmlNode3.InnerText = OofSetting.EncodeDateTime(userOofSettings.Duration.StartTime); xmlNode4.InnerText = OofSetting.EncodeDateTime(userOofSettings.Duration.EndTime); } xmlNode.AppendChild(xmlNode5); xmlNode5.AppendChild(newChild); xmlNode5.AppendChild(xmlNode7); string message = userOofSettings.InternalReply.Message; if (!string.IsNullOrEmpty(message)) { xmlNode7.InnerText = "1"; xmlNode5.AppendChild(xmlNode6); xmlNode5.AppendChild(xmlNode8); if (flag) { xmlNode6.InnerText = message; xmlNode8.InnerText = "HTML"; } else { xmlNode6.InnerText = OofSetting.InternalHtmlToText(message); xmlNode8.InnerText = "TEXT"; } } else { xmlNode7.InnerText = "0"; } xmlNode.AppendChild(xmlNode9); string message2 = userOofSettings.ExternalReply.Message; if (!string.IsNullOrEmpty(message2)) { xmlNode9.AppendChild(newChild2); xmlNode9.AppendChild(xmlNode11); xmlNode9.AppendChild(xmlNode10); xmlNode9.AppendChild(xmlNode12); if (userOofSettings.ExternalAudience != ExternalAudience.None) { xmlNode11.InnerText = "1"; } else { xmlNode11.InnerText = "0"; } if (flag) { xmlNode10.InnerText = message2; xmlNode12.InnerText = "HTML"; } else { xmlNode10.InnerText = OofSetting.InternalHtmlToText(message2); xmlNode12.InnerText = "TEXT"; } } else { xmlNode9.AppendChild(newChild2); xmlNode9.AppendChild(xmlNode11); xmlNode11.InnerText = "0"; } xmlNode.AppendChild(xmlNode13); if (!string.IsNullOrEmpty(message2)) { xmlNode13.AppendChild(newChild3); xmlNode13.AppendChild(xmlNode15); xmlNode13.AppendChild(xmlNode14); xmlNode13.AppendChild(xmlNode16); if (userOofSettings.ExternalAudience == ExternalAudience.All) { xmlNode15.InnerText = "1"; } else { xmlNode15.InnerText = "0"; } xmlNode14.InnerText = xmlNode10.InnerText; xmlNode16.InnerText = xmlNode12.InnerText; } else { xmlNode13.AppendChild(newChild3); xmlNode13.AppendChild(xmlNode15); xmlNode15.InnerText = "0"; } this.verbResponseNodes.Add(xmlNode); AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Done processing Oof - Get."); } }
private void CommitAndLoad() { this.oofSettings = UserOofSettings.GetUserOofSettings(this.userContext.MailboxSession); this.Load(); bool flag = false; if (Utilities.IsPostRequest(this.request) && !string.IsNullOrEmpty(base.Command)) { string formParameter = Utilities.GetFormParameter(this.request, "rdoOof", false); if (!string.IsNullOrEmpty(formParameter)) { bool flag2 = formParameter == 1.ToString(); bool flag3 = Utilities.GetFormParameter(this.request, "chkTmd", false) != null; if (!flag2) { if (this.oofSettings.OofState != OofState.Disabled) { this.oofSettings.OofState = OofState.Disabled; flag = true; } } else if (flag3) { if (this.oofSettings.OofState != OofState.Scheduled) { this.oofSettings.OofState = OofState.Scheduled; flag = true; } string formParameter2 = Utilities.GetFormParameter(this.request, "selSM", false); string formParameter3 = Utilities.GetFormParameter(this.request, "selSD", false); string formParameter4 = Utilities.GetFormParameter(this.request, "selSY", false); string formParameter5 = Utilities.GetFormParameter(this.request, "selST", false); string formParameter6 = Utilities.GetFormParameter(this.request, "selEM", false); string formParameter7 = Utilities.GetFormParameter(this.request, "selED", false); string formParameter8 = Utilities.GetFormParameter(this.request, "selEY", false); string formParameter9 = Utilities.GetFormParameter(this.request, "selET", false); if (string.IsNullOrEmpty(formParameter2) || string.IsNullOrEmpty(formParameter3) || string.IsNullOrEmpty(formParameter4) || string.IsNullOrEmpty(formParameter5) || string.IsNullOrEmpty(formParameter6) || string.IsNullOrEmpty(formParameter7) || string.IsNullOrEmpty(formParameter8) || string.IsNullOrEmpty(formParameter9)) { base.SetInfobarMessage(string.Format(LocalizedStrings.GetNonEncoded(1140546334), this.userContext.UserOptions.DateFormat), InfobarMessageType.Error); return; } int num = int.Parse(formParameter3); if (num > ExDateTime.DaysInMonth(int.Parse(formParameter4), int.Parse(formParameter2))) { num = ExDateTime.DaysInMonth(int.Parse(formParameter4), int.Parse(formParameter2)); } ExDateTime t = new ExDateTime(this.userContext.TimeZone, int.Parse(formParameter4), int.Parse(formParameter2), num); num = int.Parse(formParameter7); if (num > ExDateTime.DaysInMonth(int.Parse(formParameter8), int.Parse(formParameter6))) { num = ExDateTime.DaysInMonth(int.Parse(formParameter8), int.Parse(formParameter6)); } ExDateTime t2 = new ExDateTime(this.userContext.TimeZone, int.Parse(formParameter8), int.Parse(formParameter6), num); t = t.AddHours((double)int.Parse(formParameter5)); t2 = t2.AddHours((double)int.Parse(formParameter9)); if (t > t2) { base.SetInfobarMessage(LocalizedStrings.GetNonEncoded(107113300), InfobarMessageType.Error); this.isInvalidDuration = true; } if (this.oofSettings.Duration == null) { this.oofSettings.Duration = new Duration(); } if (this.oofSettings.Duration.StartTime != (DateTime)t.ToUtc()) { this.oofSettings.Duration.StartTime = (DateTime)t.ToUtc(); flag = true; } if (this.oofSettings.Duration.EndTime != (DateTime)t2.ToUtc()) { this.oofSettings.Duration.EndTime = (DateTime)t2.ToUtc(); flag = true; } } else if (this.oofSettings.OofState != OofState.Enabled) { this.oofSettings.OofState = OofState.Enabled; flag = true; } string formParameter10 = Utilities.GetFormParameter(this.request, "txtInt", false); string formParameter11 = Utilities.GetFormParameter(this.request, "chkInt", false); if (((formParameter11 == null && string.IsNullOrEmpty(this.oofToInternal)) || !string.IsNullOrEmpty(formParameter11)) && !Utilities.WhiteSpaceOnlyOrNullEmpty(formParameter10)) { this.oofSettings.InternalReply.Message = BodyConversionUtilities.ConvertTextToHtml(formParameter10); flag = true; } string formParameter12 = Utilities.GetFormParameter(this.request, "txtExt", false); string formParameter13 = Utilities.GetFormParameter(this.request, "chkExt", false); if (((formParameter13 == null && string.IsNullOrEmpty(this.oofToExternal)) || !string.IsNullOrEmpty(formParameter13)) && !Utilities.WhiteSpaceOnlyOrNullEmpty(formParameter12)) { this.oofSettings.ExternalReply.Message = BodyConversionUtilities.ConvertTextToHtml(formParameter12); flag = true; } if (Utilities.GetFormParameter(this.request, "chkExtSnd", false) != null) { string formParameter14 = Utilities.GetFormParameter(this.request, "rdoAll", false); if (!string.IsNullOrEmpty(formParameter14)) { if (formParameter14 == 3.ToString()) { if (this.oofSettings.ExternalAudience != ExternalAudience.All) { this.oofSettings.ExternalAudience = ExternalAudience.All; flag = true; } } else if (this.oofSettings.ExternalAudience != ExternalAudience.Known) { this.oofSettings.ExternalAudience = ExternalAudience.Known; flag = true; } } } else if (this.oofSettings.ExternalAudience != ExternalAudience.None) { this.oofSettings.ExternalAudience = ExternalAudience.None; flag = true; } if (flag) { try { this.oofSettings.Save(this.userContext.MailboxSession); base.SetSavedSuccessfully(true); } catch (InvalidScheduledOofDuration) { base.SetInfobarMessage(LocalizedStrings.GetNonEncoded(-561991348), InfobarMessageType.Error); this.isInvalidDuration = true; } this.Load(); } } } }