コード例 #1
0
        public ReminderSchedule ToSDKReminderSchedule()
        {
            if (sdk != null)
            {
                return(sdk);
            }
            else
            {
                ReminderSchedule result = new ReminderSchedule();
                if (api.PackageId != null && !api.PackageId.Equals(""))
                {
                    result.PackageId = new PackageId(api.PackageId);
                }
                if (api.StartInDaysDelay.HasValue)
                {
                    result.DaysUntilFirstReminder = api.StartInDaysDelay.Value;
                }
                if (api.IntervalInDays.HasValue)
                {
                    result.DaysBetweenReminders = api.IntervalInDays.Value;
                }
                if (api.RepetitionsCount.HasValue)
                {
                    result.NumberOfRepetitions = api.RepetitionsCount.Value;
                }

                foreach (PackageReminder apiReminder in api.Reminders)
                {
                    result.Reminders.Add(new ReminderConverter(apiReminder).ToSDKReminder());
                }
                return(result);
            }
        }
コード例 #2
0
        public ReminderSchedule Build()
        {
            ReminderSchedule result = new ReminderSchedule();

            result.PackageId              = packageId;
            result.DaysBetweenReminders   = daysBetweenReminders;
            result.DaysUntilFirstReminder = daysUntilFirstReminder;
            result.NumberOfRepetitions    = numberOfRepetitions;

            return(result);
        }
コード例 #3
0
 public ReminderScheduleConverter(ReminderSchedule sdk)
 {
     this.api = null;
     this.sdk = sdk;
 }
コード例 #4
0
 public ReminderScheduleConverter(PackageReminderSchedule api)
 {
     this.api = api;
     this.sdk = null;
 }