コード例 #1
0
        private void SaveData()
        {
            _exerciseSchedule.Period = (SchedulePeriod)_reminderPeriodSpinner.SelectedItemPosition;
            _exerciseSchedule.Type   = (ScheduleType)_scheduleTypeSpinner.SelectedItemPosition;


            if (_selectedStartTime >= _selectedEndTime)
            {
                _userNotification.ShowValidationErrorPopUp(this, Resource.String.TimeRangeValidation);
                return;
            }

            _exerciseSchedule.StartTime = _selectedStartTime;
            _exerciseSchedule.EndTime   = _selectedEndTime;

            Data.SaveExerciseSchedule(_exerciseSchedule);
            _exerciseSchedule = Data.GetExerciseSchedule();
            _serviceManager.RestartNotificationServiceIfNeeded(this, _exerciseSchedule);
            Data.SetMovementLocationsEnabled(_movementLocationsEnabledCheckbox.Checked);

            Data.InsertAllMovementLocations(_updatedMovementLocations.Except(_initialMovementLocations));
            Data.DeleteAllMovementLocations(_initialMovementLocations.Except(_updatedMovementLocations).Select(ml => ml.Id));

            Finish();
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            if (this.RevealViewController() == null)
            {
                return;
            }

            View.AddGestureRecognizer(this.RevealViewController().PanGestureRecognizer);
            _serviceManager.RestartNotificationServiceIfNeeded();
        }