示例#1
0
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     if (Debugger.IsAttached)
     {
         Debugger.Break();
     }
     LittleWatson.ReportException(e.ExceptionObject, "UnhandledException");
     LittleWatson.CheckForPreviousException(false);
     e.Handled = true;
 }
示例#2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            LittleWatson.CheckForPreviousException(true);

            if (App.Crawler != null)
            {
                return;
            }

            var email    = Settings.GetString(Setting.Email);
            var password = Settings.GetString(Setting.Password);

            if (e.NavigationMode != NavigationMode.Back && (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password)))
            {
                OnSettingsClick(null, null);
            }
            else
            {
                LoadCourses(email, password, false);
            }
        }
示例#3
0
        private void OnLectureVideoClick(object sender, RoutedEventArgs e)
        {
            if (videoLazyBlock != null)
            {
                return;
            }

            var lecture = (Coursera.Lecture)((Button)sender).DataContext;

            videoLazyBlock = new LazyBlock <string>(
                "video",
                null,
                lecture.VideoUrl,
                _ => false,
                new LazyBlockUI <string>(
                    this,
                    videoUrl =>
            {
                try
                {
                    var launcher   = new MediaPlayerLauncher();
                    launcher.Media = new Uri(videoUrl, UriKind.Absolute);
                    launcher.Show();
                }
                catch (Exception ex)
                {
                    LittleWatson.ReportException(ex, string.Format("Opening video for lecture '{0}' of course '{1}' ({2})", lecture.Title, pivot.Title, videoUrl));
                    LittleWatson.CheckForPreviousException(false);
                }
            },
                    () => false,
                    null),
                false,
                null,
                _ => videoLazyBlock = null,
                null);
        }
示例#4
0
 public void OnException(string message, Exception e)
 {
     LittleWatson.ReportException(e, message);
     LittleWatson.CheckForPreviousException(false);
 }