// 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());
        }
        // Token: 0x060009EA RID: 2538 RVA: 0x00041AB4 File Offset: 0x0003FCB4
        internal static string BuildVoiceSettingsItemBody(VoiceNotificationSettings settings)
        {
            StringBuilder stringBuilder = new StringBuilder(128);

            stringBuilder.AppendLine("V1.0");
            stringBuilder.AppendLine(settings.TimeZone.ExTimeZone.Id);
            stringBuilder.AppendLine(settings.Enabled ? "1" : "0");
            SettingsItemBodyParser.CheckSettingsItemBodyLength(stringBuilder.Length);
            return(stringBuilder.ToString());
        }
        // Token: 0x060009F1 RID: 2545 RVA: 0x00041D94 File Offset: 0x0003FF94
        private static ExTimeZone GetNextTimeZone(StringReader reader)
        {
            ExTimeZone exTimeZone;

            if (!ExTimeZoneEnumerator.Instance.TryGetTimeZoneByName(SettingsItemBodyParser.GetNextLine(reader), out exTimeZone))
            {
                SettingsItemBodyParser.Tracer.TraceDebug(0L, "Unknown time zone, change to default");
                exTimeZone = ((ExTimeZoneValue)WorkingHoursSchema.WorkingHoursTimeZone.DefaultValue).ExTimeZone;
            }
            return(exTimeZone);
        }
        // Token: 0x060009F0 RID: 2544 RVA: 0x00041D6C File Offset: 0x0003FF6C
        private static int GetNextInteger(StringReader reader)
        {
            string nextLine = SettingsItemBodyParser.GetNextLine(reader);
            int    result;

            if (int.TryParse(nextLine, out result))
            {
                return(result);
            }
            throw new FormatException();
        }
 // 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);
 }
 // Token: 0x06000A7F RID: 2687 RVA: 0x00044EB4 File Offset: 0x000430B4
 private bool TryGetVoiceSettingsFromSettingsItemBody(string settingsItemBody, string legacyDN, out VoiceNotificationSettings voiceSettings)
 {
     voiceSettings = null;
     try
     {
         voiceSettings = SettingsItemBodyParser.ParseVoiceSettingsItemBody(settingsItemBody);
     }
     catch (FormatException ex)
     {
         ExTraceGlobals.SystemMailboxTracer.TraceDebug <string, string>((long)this.GetHashCode(), "User {0}'s setting item is corrupted, skipped. Exception message {1} ", legacyDN, ex.Message);
     }
     return(voiceSettings != null);
 }
        // Token: 0x060009EF RID: 2543 RVA: 0x00041D34 File Offset: 0x0003FF34
        private static bool GetNextBoolean(StringReader reader)
        {
            string nextLine = SettingsItemBodyParser.GetNextLine(reader);

            if (nextLine == "1")
            {
                return(true);
            }
            if (nextLine == "0")
            {
                return(false);
            }
            throw new FormatException();
        }
        // Token: 0x060009EB RID: 2539 RVA: 0x00041B1C File Offset: 0x0003FD1C
        internal static VoiceNotificationSettings ParseVoiceSettingsItemBody(string body)
        {
            VoiceNotificationSettings result;

            using (StringReader stringReader = new StringReader(body))
            {
                if (!string.Equals(SettingsItemBodyParser.GetNextLine(stringReader), "V1.0"))
                {
                    SettingsItemBodyParser.Tracer.TraceDebug(0L, "Unknown user  voice settings version, skipped");
                    throw new FormatException();
                }
                ExTimeZoneValue           timeZone    = new ExTimeZoneValue(SettingsItemBodyParser.GetNextTimeZone(stringReader));
                bool                      nextBoolean = SettingsItemBodyParser.GetNextBoolean(stringReader);
                VoiceNotificationSettings voiceNotificationSettings = new VoiceNotificationSettings(nextBoolean, timeZone);
                result = voiceNotificationSettings;
            }
            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: 0x06000A22 RID: 2594 RVA: 0x00042DA7 File Offset: 0x00040FA7
 internal override string BuildSettingsItemBody(UserSettings settings)
 {
     return(SettingsItemBodyParser.BuildTextSettingsItemBody(settings.Text));
 }
 // Token: 0x06000A7B RID: 2683 RVA: 0x00044E11 File Offset: 0x00043011
 internal override string BuildSettingsItemBody(UserSettings settings)
 {
     return(SettingsItemBodyParser.BuildVoiceSettingsItemBody(settings.Voice));
 }