コード例 #1
0
        protected override void OnStop()
        {
            if (!outsideActivity.Done && outsideActivity.DurationMilliseconds < 1)
            {
                _dataService.DeleteOutsideActivity(outsideActivity);
            }

            base.OnStop();
        }
コード例 #2
0
        private void _discardActivityButton_Click(object sender, EventArgs e)
        {
            // reset the chronometer
            _currentActivityChronometer.Stop();
            _currentOutsideActivity.IsPaused   = true;
            _currentOutsideActivity.IsTracking = false;
            ResetChronometer();

            // delete the outside activity from the database and reset the outside activity
            _dataService.DeleteOutsideActivity(_currentOutsideActivity);
            _currentOutsideActivity = new OutsideActivity();

            // reset the view
            SetSaveActivityView();
        }