Esempio n. 1
0
        // Token: 0x06000A6E RID: 2670 RVA: 0x000449FC File Offset: 0x00042BFC
        internal static bool AreInterestedFieldsEqual(VoiceNotificationSettings voiceSettings1, VoiceNotificationSettings voiceSettings2)
        {
            bool result;

            if (Utils.CheckMembers(voiceSettings1, voiceSettings2, out result))
            {
                return(voiceSettings1.TimeZone == voiceSettings2.TimeZone && voiceSettings1.Enabled == voiceSettings2.Enabled);
            }
            return(result);
        }
        // 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: 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: 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);
 }