コード例 #1
0
        public void ChangeTimeEntryDuration(TimeSpan newDuration, TimeEntryData timeEntryData)
        {
            // TODO: for the moment, old style methods
            // using existing models.
            var entryModel = new TimeEntryModel(timeEntryData);

            entryModel.SetDuration(newDuration);
            timeEntryList [timeEntryList.IndexOf(p => p.Id == entryModel.Id)] = entryModel.Data;
            UpdateView();

            ServiceContainer.Resolve <ITracker> ().CurrentScreen = "Change Group Duration";
        }
 private async void OnOkClicked(object sender, DialogClickEventArgs e)
 {
     if (enabled && model != null)
     {
         var duration = model.GetDuration();
         if (model.State == TimeEntryState.New)
         {
             duration = new TimeSpan(newDuration.Hours, newDuration.Minutes, 0);
         }
         else
         {
             // Keep the current seconds and milliseconds
             duration = new TimeSpan(0, newDuration.Hours, newDuration.Minutes, duration.Seconds, duration.Milliseconds);
         }
         model.SetDuration(duration);
         await model.SaveAsync();
     }
 }
コード例 #3
0
 public void ChangeTimeEntryDuration(TimeSpan newDuration)
 {
     data = TimeEntryModel.SetDuration(data, newDuration);
     UpdateView();
     ServiceContainer.Resolve <ITracker> ().CurrentScreen = "Change Duration";
 }
コード例 #4
0
        public void ChangeTimeEntryDuration (TimeSpan newDuration, TimeEntryData timeEntryData)
        {
            // TODO: for the moment, old style methods
            // using existing models.
            var entryModel = new TimeEntryModel (timeEntryData);
            entryModel.SetDuration (newDuration);
            timeEntryList [timeEntryList.IndexOf (p => p.Id == entryModel.Id)] = entryModel.Data;
            UpdateView ();

            ServiceContainer.Resolve<ITracker> ().CurrentScreen = "Change Group Duration";
        }