Esempio n. 1
0
 private void OnDeleteClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     _memoPlayerViewModel.Remove();
     StopMemoPlaying();
 }
Esempio n. 2
0
        private void OnImageManipulationStarted(object sender, ManipulationStartedEventArgs e)
        {
            BitmapImage img = new BitmapImage(new Uri(
                                                  "/Resources/Images/TryToPlay_press.png", UriKind.Relative));

            _tryToPlayImage.Source = img;

            AnniversaryViewModel viewModel = (AnniversaryViewModel)_ringtoneListPicker.DataContext;

            switch (viewModel.RingTone)
            {
            case RingTone.SchoolBell:
                SoundUtilities.Instance().Play(SoundType.SchoolBell);
                break;

            case RingTone.Chaotic:
                SoundUtilities.Instance().Play(SoundType.Chaotic);
                break;

            case RingTone.DingTone:
                SoundUtilities.Instance().Play(SoundType.DingTone);
                break;

            default:
                break;
            }

            base.OnManipulationStarted(e);
        }
Esempio n. 3
0
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            switch (_mode)
            {
            case MainPageMode.MainView:
                base.OnBackKeyPress(e);
                break;

            case MainPageMode.MemoRecording:
                _mode = MainPageMode.MainView;
                StopMemoRecording();
                e.Cancel = true;
                break;

            case MainPageMode.MemoPlaying:
                _mode = MainPageMode.MainView;
                StopMemoPlaying();
                e.Cancel = true;
                break;

            default:
                break;
            }
        }
Esempio n. 4
0
        private void OnAboutClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            this.NavigationService.Navigate(
                new Uri("/AboutPage.xaml", UriKind.Relative));
        }
Esempio n. 5
0
        private void OnAlarmClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            string startTimeStr = _calendarMonthView.CurrentDay.ToLongDateString();

            this.NavigationService.Navigate(
                new Uri("/AlarmPage.xaml?StartTime=" + startTimeStr, UriKind.Relative));
        }
Esempio n. 6
0
        private void OnResumeClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            _memoPlayerViewModel.Resume();
            _memoPlayerPanel.Start();

            this.ApplicationBar.Buttons.Remove(_resumeAppbarIconButton);
            this.ApplicationBar.Buttons.Insert(0, _pauseAppbarIconButton);
        }
Esempio n. 7
0
        private void OnMemoClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            BeginRecorderStoryboard.Begin();

            this.ApplicationBar.Buttons.Clear();
            this.ApplicationBar.Buttons.Add(_stopAppbarIconButton);

            DisableApplicationBar();
        }
Esempio n. 8
0
        private bool AssertApply()
        {
            bool ret = false;

            if (string.IsNullOrEmpty(_AnniversaryViewModel.Subject) ||
                _AnniversaryViewModel.Subject == AppResources.EnterSubjectText)
            {
                SoundUtilities.Instance().Play(SoundType.Note);
                VibrateUtilities.Instance().Vibrate(VibrateType.ShortVibrate);

                MessageBox.Show(
                    AppResources.EmptySubjectWarningText,
                    AppResources.WarningTitleText,
                    MessageBoxButton.OK
                    );
            }
            else if (_AnniversaryViewModel.AlarmOn &&
                     ((_AnniversaryViewModel.AlarmTime < DateTime.Now &&
                       _AnniversaryViewModel.RepeatType == RepeatType.NotRepeated) ||
                      _AnniversaryViewModel.ExpirationTime < DateTime.Now))
            {
                SoundUtilities.Instance().Play(SoundType.Note);
                VibrateUtilities.Instance().Vibrate(VibrateType.ShortVibrate);

                MessageBox.Show(
                    AppResources.AlarmExpiredWarningText,
                    AppResources.WarningTitleText,
                    MessageBoxButton.OK
                    );
            }
            else if (_AnniversaryViewModel.AlarmOn &&
                     _startTime.Date > _AnniversaryViewModel.ExpirationTime)
            {
                SoundUtilities.Instance().Play(SoundType.Note);
                VibrateUtilities.Instance().Vibrate(VibrateType.ShortVibrate);

                MessageBox.Show(
                    AppResources.AnniversaryExpirationWarningText,
                    AppResources.WarningTitleText,
                    MessageBoxButton.OK
                    );
            }
            else
            {
                ret = true;
            }

            return(ret);
        }
Esempio n. 9
0
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.VerticalVelocity > FlickVelocity)
            {
                SoundUtilities.Instance().Play(SoundType.Slipping);
                Date       = Date.AddMonths(1);
                CurrentDay = Date;
            }

            if (e.VerticalVelocity < -FlickVelocity)
            {
                SoundUtilities.Instance().Play(SoundType.Slipping);
                Date       = Date.AddMonths(-1);
                CurrentDay = Date;
            }
        }
Esempio n. 10
0
 private void OnDatePickerTap(object sender, GestureEventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.CalendarPanelStart);
 }
Esempio n. 11
0
        private void DoBack()
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            this.NavigationService.GoBack();
        }
Esempio n. 12
0
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            base.OnBackKeyPress(e);
        }
Esempio n. 13
0
        private void OnOkClick(object sender, EventArgs e)
        {
            SoundUtilities.Instance().Play(SoundType.AppbarClicked);

            this.NavigationService.GoBack();
        }
Esempio n. 14
0
 private void OnStopClick(object sender, EventArgs e)
 {
     SoundUtilities.Instance().Play(SoundType.AppbarClicked);
     _mode = MainPageMode.MainView;
     StopMemoRecording();
 }