コード例 #1
0
        /// ------------------------------------------------------------------------------------
        public static void HandleGlobalNAudioException(object sender, CancelExceptionHandlingEventArgs e)
        {
            if (!GetIsNAudioError(e.Exception))
            {
                return;
            }

            e.Cancel = true;

            if (NAudioExceptionThrown != null)
            {
                NAudioExceptionThrown(e.Exception);
            }

            DisplayNAudioError(e.Exception);
        }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        private bool AttemptBeginAnnotationRecording(string path)
        {
            try
            {
                AudioUtils.NAudioExceptionThrown += HandleNAudioExceptionThrownDuringRecord;
                return(Recorder.BeginAnnotationRecording(path));
            }
            catch (Exception e)
            {
                AudioUtils.NAudioExceptionThrown -= HandleNAudioExceptionThrownDuringRecord;
                var args = new CancelExceptionHandlingEventArgs(e);
                AudioUtils.HandleGlobalNAudioException(this, args);
                if (!args.Cancel)
                {
                    ErrorReport.NotifyUserOfProblem(e, LocalizationManager.GetString(
                                                        "DialogBoxes.Transcription.OralAnnotationRecorderDlgBase.UnexpectedErrorAttemptingToRecordMsg",
                                                        "An unexpected error occurred when attempting to record an annotation."));
                }

                return(false);
            }
        }
コード例 #3
0
ファイル: frmSplash.cs プロジェクト: neilmayhew/pathway
 private static void ReportError(object sender, CancelExceptionHandlingEventArgs e)
 {
     Analytics.ReportException(e.Exception);
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: witheej/Glyssen
 private static void ReportError(object sender, CancelExceptionHandlingEventArgs e)
 {
     Analytics.ReportException(e.Exception);
 }