Esempio n. 1
0
        /// <summary>
        /// Catches the event when the time is set
        /// </summary>
        /// <param name="sender">The sender</param>
        /// <param name="e">The arguments</param>
        private void OnTimeSet(object sender, TimeSetEventArgs e)
        {
            string[] datetime = ItemParser.ParseDateTimeForEntry(saveDate, e.HourOfDay, e.Minute);
            string   date     = datetime[0];
            string   time     = datetime[1];

            if (!string.IsNullOrWhiteSpace(time) && !string.IsNullOrWhiteSpace(date))
            {
                RecipeCalendarEntry entry = new RecipeCalendarEntry();
                entry.RecipeId = calendarRecipe.Id;
                entry.Time     = time;
                entry.Date     = date;
                CalendarFragment.ViewModel.AddCalendarEntryCommand.Execute(entry);
                calendarRecipe.CanDelete = false;
                Log.Debug("DateTime", date + time);
            }
        }
 public void UpdateDuration(object sender, TimeSetEventArgs e)
 {
     Element.Time = new TimeSpan(e.HourOfDay, e.Minute, 0);
     Control.Text = Element.Time.Hours.ToString("00") + ":" + Element.Time.Minutes.ToString("00");
 }