// Token: 0x060009E9 RID: 2537 RVA: 0x000418EC File Offset: 0x0003FAEC
        internal static string BuildTextSettingsItemBody(TextNotificationSettings settings)
        {
            StringBuilder stringBuilder = new StringBuilder(128);

            stringBuilder.AppendLine("V1.2");
            MailboxRegionalConfiguration regionalConfiguration = settings.RegionalConfiguration;

            stringBuilder.AppendLine(regionalConfiguration.TimeZone.ExTimeZone.Id);
            stringBuilder.AppendLine((regionalConfiguration.Language != null) ? regionalConfiguration.Language.LCID.ToString() : "0");
            stringBuilder.AppendLine(regionalConfiguration.TimeFormat);
            stringBuilder.AppendLine(regionalConfiguration.DateFormat);
            CalendarNotification textNotification = settings.TextNotification;

            stringBuilder.AppendLine(textNotification.MeetingReminderNotification ? "1" : "0");
            stringBuilder.AppendLine(textNotification.MeetingReminderSendDuringWorkHour ? "1" : "0");
            stringBuilder.AppendLine(textNotification.NextDays.ToString());
            stringBuilder.AppendLine(textNotification.CalendarUpdateNotification ? "1" : "0");
            stringBuilder.AppendLine(textNotification.CalendarUpdateSendDuringWorkHour ? "1" : "0");
            stringBuilder.AppendLine(textNotification.DailyAgendaNotification ? "1" : "0");
            stringBuilder.AppendLine(((int)textNotification.DailyAgendaNotificationSendTime.TotalSeconds).ToString());
            stringBuilder.AppendLine(textNotification.TextMessagingPhoneNumber.ToString());
            StorageWorkingHours workingHours = settings.WorkingHours;

            stringBuilder.AppendLine(workingHours.TimeZone.Id);
            stringBuilder.AppendLine(((int)workingHours.DaysOfWeek).ToString());
            stringBuilder.AppendLine(workingHours.StartTimeInMinutes.ToString());
            stringBuilder.AppendLine(workingHours.EndTimeInMinutes.ToString());
            SettingsItemBodyParser.CheckSettingsItemBodyLength(stringBuilder.Length);
            return(stringBuilder.ToString());
        }
예제 #2
0
        // Token: 0x06000A6F RID: 2671 RVA: 0x00044A3C File Offset: 0x00042C3C
        internal static bool AreInterestedFieldsEqual(TextNotificationSettings textSettings1, TextNotificationSettings textSettings2)
        {
            bool result;

            if (Utils.CheckMembers(textSettings1, textSettings2, out result))
            {
                return(Utils.AreInterestedFieldsEqual(textSettings1.RegionalConfiguration, textSettings2.RegionalConfiguration) && Utils.AreInterestedFieldsEqual(textSettings1.TextNotification, textSettings2.TextNotification) && Utils.AreInterestedFieldsEqual(textSettings1.WorkingHours, textSettings2.WorkingHours));
            }
            return(result);
        }
        // Token: 0x060009EC RID: 2540 RVA: 0x00041B98 File Offset: 0x0003FD98
        internal static TextNotificationSettings ParseTextSettingsItemBody(string body)
        {
            TextNotificationSettings result;

            using (StringReader stringReader = new StringReader(body))
            {
                if (SettingsItemBodyParser.GetNextLine(stringReader) != "V1.2")
                {
                    SettingsItemBodyParser.Tracer.TraceDebug(0L, "Unknown user settings version, skipped");
                    throw new FormatException();
                }
                MailboxRegionalConfiguration mailboxRegionalConfiguration = new MailboxRegionalConfiguration();
                mailboxRegionalConfiguration.TimeZone = new ExTimeZoneValue(SettingsItemBodyParser.GetNextTimeZone(stringReader));
                int nextInteger = SettingsItemBodyParser.GetNextInteger(stringReader);
                if (nextInteger != 0)
                {
                    mailboxRegionalConfiguration.Language = new CultureInfo(nextInteger);
                }
                mailboxRegionalConfiguration.TimeFormat = SettingsItemBodyParser.GetNextLine(stringReader);
                mailboxRegionalConfiguration.DateFormat = SettingsItemBodyParser.GetNextLine(stringReader);
                CalendarNotification calendarNotification = new CalendarNotification();
                calendarNotification.MeetingReminderNotification       = SettingsItemBodyParser.GetNextBoolean(stringReader);
                calendarNotification.MeetingReminderSendDuringWorkHour = SettingsItemBodyParser.GetNextBoolean(stringReader);
                calendarNotification.NextDays = SettingsItemBodyParser.GetNextInteger(stringReader);
                calendarNotification.CalendarUpdateNotification       = SettingsItemBodyParser.GetNextBoolean(stringReader);
                calendarNotification.CalendarUpdateSendDuringWorkHour = SettingsItemBodyParser.GetNextBoolean(stringReader);
                calendarNotification.DailyAgendaNotification          = SettingsItemBodyParser.GetNextBoolean(stringReader);
                calendarNotification.DailyAgendaNotificationSendTime  = TimeSpan.FromSeconds((double)SettingsItemBodyParser.GetNextInteger(stringReader));
                E164Number textMessagingPhoneNumber;
                if (!E164Number.TryParse(SettingsItemBodyParser.GetNextLine(stringReader), out textMessagingPhoneNumber))
                {
                    SettingsItemBodyParser.Tracer.TraceDebug(0L, "Invalid phone number, skipped");
                    throw new FormatException();
                }
                calendarNotification.TextMessagingPhoneNumber = textMessagingPhoneNumber;
                ExTimeZone          nextTimeZone = SettingsItemBodyParser.GetNextTimeZone(stringReader);
                int                 nextInteger2 = SettingsItemBodyParser.GetNextInteger(stringReader);
                int                 nextInteger3 = SettingsItemBodyParser.GetNextInteger(stringReader);
                int                 nextInteger4 = SettingsItemBodyParser.GetNextInteger(stringReader);
                StorageWorkingHours workingHours = StorageWorkingHours.Create(nextTimeZone, nextInteger2, nextInteger3, nextInteger4);
                result = new TextNotificationSettings(mailboxRegionalConfiguration, calendarNotification, workingHours);
            }
            return(result);
        }
 // Token: 0x06000A26 RID: 2598 RVA: 0x00042EE4 File Offset: 0x000410E4
 private bool TryGetTextSettingsFromSettingsItemBody(string settingsItemBody, string legacyDN, out TextNotificationSettings textSettings)
 {
     textSettings = null;
     try
     {
         textSettings = SettingsItemBodyParser.ParseTextSettingsItemBody(settingsItemBody);
     }
     catch (FormatException)
     {
         ExTraceGlobals.SystemMailboxTracer.TraceDebug <string>((long)this.GetHashCode(), "User {0}'s setting item is corrupted, skipped.", legacyDN);
     }
     return(textSettings != null);
 }