Exemplo n.º 1
0
 public TaskReminder(TaskReminder src)
 {
     Id = src.Id;
     Sid = src.Sid;
     UserId = src.UserId;
     TaskId = src.TaskId;
     TaskSid = src.TaskSid;
     Duration = new TickTickDuration(src.GetDurationString());
 }
Exemplo n.º 2
0
 public static DateTime? CalculateRemindTime(TickTickDuration duration, long dueTime)
 {
     if (dueTime <= 0 || duration == null)
     {
         return null;
     }
     Calendar calendar = new Calendar();
     //calendar.setTimeInMillis(dueTime); // TODO 有问题
     duration.AddDurationToDate(calendar);
     return DateTimeUtils.ClearSecondOfDay(calendar.GetDateTime().DateTime).Value;
 }
Exemplo n.º 3
0
 public void SetDuration(String durationStr)
 {
     try
     {
         if (!string.IsNullOrEmpty(durationStr))
         {
             _duration = new TickTickDuration(durationStr);
             return;
         }
     }
     catch (Exception e)
     {
         //Log.e("TaskReminder", "To TickTickDuration failed, durationStr = " + durationStr);
     }
     _duration = null;
 }
Exemplo n.º 4
0
 public bool EqualValue(TickTickDuration duration)
 {
     return duration != null && ToMillis() == duration.ToMillis();
 }
Exemplo n.º 5
0
 private static TickTickDuration GetRevisedDuration(TickTickDuration original, TickTickDuration delta, TickTickDuration revised)
 {
     if (original.Equals(delta))
     {
         return revised;
     }
     else if (original.Equals(revised))
     {
         return delta;
     }
     return revised;
 }