Example #1
0
        protected override void SaveXsoObject(IConfigDataProvider provider, IConfigurable dataObject)
        {
            Exception ex = null;

            try
            {
                TextMessagingHelper.SaveTextMessagingAccount((TextMessagingAccount)dataObject, (VersionedXmlDataProvider)provider, this.DataObject, (IRecipientSession)base.DataSession);
                CalendarNotification calendarNotification = (CalendarNotification)provider.Read <CalendarNotification>(this.DataObject.Identity);
                if (calendarNotification.TextMessagingPhoneNumber != ((TextMessagingAccount)dataObject).NotificationPhoneNumber)
                {
                    calendarNotification.TextMessagingPhoneNumber = ((TextMessagingAccount)dataObject).NotificationPhoneNumber;
                    provider.Save(calendarNotification);
                }
            }
            catch (ObjectExistedException ex2)
            {
                ex = ex2;
            }
            catch (SaveConflictException ex3)
            {
                ex = ex3;
            }
            catch (ADObjectEntryAlreadyExistsException ex4)
            {
                ex = ex4;
            }
            if (ex != null)
            {
                base.WriteError(new ConflictSavingException(this.DataObject.Identity.ToString(), ex), ErrorCategory.InvalidOperation, this.Identity);
            }
        }
        // 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());
        }
Example #3
0
 // Token: 0x06000A64 RID: 2660 RVA: 0x000445CC File Offset: 0x000427CC
 internal static bool TryLoadTextNotification(MailboxSession session, out CalendarNotification textNotification)
 {
     textNotification = null;
     using (VersionedXmlDataProvider versionedXmlDataProvider = new VersionedXmlDataProvider(session))
     {
         textNotification = (CalendarNotification)versionedXmlDataProvider.Read <CalendarNotification>(session.MailboxOwner.ObjectId);
     }
     return(textNotification != null);
 }
Example #4
0
        // Token: 0x06000A6A RID: 2666 RVA: 0x00044864 File Offset: 0x00042A64
        internal static bool AreInterestedFieldsEqual(CalendarNotification value1, CalendarNotification value2)
        {
            bool result;

            if (Utils.CheckMembers(value1, value2, out result))
            {
                return(value1.CalendarUpdateNotification == value2.CalendarUpdateNotification && value1.CalendarUpdateSendDuringWorkHour == value2.CalendarUpdateSendDuringWorkHour && value1.DailyAgendaNotification == value2.DailyAgendaNotification && value1.DailyAgendaNotificationSendTime == value2.DailyAgendaNotificationSendTime && value1.MeetingReminderNotification == value2.MeetingReminderNotification && value1.MeetingReminderSendDuringWorkHour == value2.MeetingReminderSendDuringWorkHour && value1.NextDays == value2.NextDays && value1.TextMessagingPhoneNumber == value2.TextMessagingPhoneNumber);
            }
            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);
        }
Example #6
0
 // Token: 0x06000A69 RID: 2665 RVA: 0x0004483A File Offset: 0x00042A3A
 internal static bool TextNotificationIsEnabled(CalendarNotification textNotification)
 {
     return((textNotification.CalendarUpdateNotification || textNotification.DailyAgendaNotification || textNotification.MeetingReminderNotification) && textNotification.TextMessagingPhoneNumber != null);
 }
Example #7
0
 public static void AddNotificationConfigDataPoint(SmsSqmSession instance, ADObjectId id, string legacyDN, CalendarNotification calendarNotification)
 {
     if (instance.Enabled)
     {
         if (calendarNotification.CalendarUpdateNotification)
         {
             SmsSqmDataPointHelper.AddNotificationConfigDataPoint(instance, id, legacyDN, SMSNotificationType.CalendarUpdate);
         }
         if (calendarNotification.MeetingReminderNotification)
         {
             SmsSqmDataPointHelper.AddNotificationConfigDataPoint(instance, id, legacyDN, SMSNotificationType.CalendarReminder);
         }
         if (calendarNotification.DailyAgendaNotification)
         {
             SmsSqmDataPointHelper.AddNotificationConfigDataPoint(instance, id, legacyDN, SMSNotificationType.CalendarAgenda);
         }
     }
 }
 public CalendarNotificationSettings(CalendarNotification calendarNotification) : base(calendarNotification)
 {
     this.CalendarNotification = calendarNotification;
 }
 // Token: 0x06000A35 RID: 2613 RVA: 0x000436D9 File Offset: 0x000418D9
 internal TextNotificationSettings(MailboxRegionalConfiguration regionalConfiguration, CalendarNotification textNotification, StorageWorkingHours workingHours)
 {
     this.RegionalConfiguration = regionalConfiguration;
     this.TextNotification      = textNotification;
     this.WorkingHours          = workingHours;
 }