• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ExceptionEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ExceptionEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ExceptionEventArgs类的具体用法?C# ExceptionEventArgs怎么用?C# ExceptionEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExceptionEventArgs类属于命名空间,在下文中一共展示了ExceptionEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnCallbackException

        internal bool OnCallbackException(Exception exception)
        {
            var args = new ExceptionEventArgs(exception);
            OnCallbackException(args);

            return args.Handled;
        }
开发者ID:WLSF,项目名称:SampSharp,代码行数:7,代码来源:BaseMode.callbacks.cs


示例2: FileLoader_GetFileAsTextFailed

 void FileLoader_GetFileAsTextFailed(object sender, ExceptionEventArgs e)
 {
     if (e.Exception != null)
         OnGetConnectionsFailed(new ExceptionEventArgs(e.Exception, e.UserState));
     else
         OnGetConnectionsFailed(new ExceptionEventArgs(new Exception(Resources.Strings.ExceptionUnknownError), e.UserState));
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:7,代码来源:FileConnectionsProvider.cs


示例3: Arrange

        protected void Arrange()
        {
            var random = new Random();
            _subsystemName = random.Next().ToString(CultureInfo.InvariantCulture);
            _operationTimeout = TimeSpan.FromSeconds(30);
            _encoding = Encoding.UTF8;
            _disconnectedRegister = new List<EventArgs>();
            _errorOccurredRegister = new List<ExceptionEventArgs>();
            _errorOccurredEventArgs = new ExceptionEventArgs(new SystemException());

            _sessionMock = new Mock<ISession>(MockBehavior.Strict);
            _channelMock = new Mock<IChannelSession>(MockBehavior.Strict);

            _sequence = new MockSequence();
            _sessionMock.InSequence(_sequence).Setup(p => p.CreateChannelSession()).Returns(_channelMock.Object);
            _channelMock.InSequence(_sequence).Setup(p => p.Open());
            _channelMock.InSequence(_sequence).Setup(p => p.SendSubsystemRequest(_subsystemName)).Returns(true);

            _subsystemSession = new SubsystemSessionStub(
                _sessionMock.Object,
                _subsystemName,
                _operationTimeout,
                _encoding);
            _subsystemSession.Disconnected += (sender, args) => _disconnectedRegister.Add(args);
            _subsystemSession.ErrorOccurred += (sender, args) => _errorOccurredRegister.Add(args);
            _subsystemSession.Connect();
        }
开发者ID:delfinof,项目名称:ssh.net,代码行数:27,代码来源:SubsystemSession_OnSessionErrorOccurred_Connected.cs


示例4: OnException

 protected virtual void OnException(ExceptionEventArgs e)
 {
     if (this.Exception != null)
     {
         this.Exception(this, e);
     }
 }
开发者ID:jacktsai,项目名称:ApiFoundation,代码行数:7,代码来源:ExceptionFilter.cs


示例5: onThrowException

protected virtual void onThrowException(ExceptionEventArgs e)
{
    EventHandler<ExceptionEventArgs> handler = ThrowException;

            if(handler != null)
            {
                handler(this, e);
            }
}
开发者ID:dbaileychess,项目名称:Compass,代码行数:9,代码来源:Phosphinator.cs


示例6: ExceptionEventArgs_Unit_BubbleException_True

        public void ExceptionEventArgs_Unit_BubbleException_True()
        {
            Exception exception = new ApplicationException("This is a test.").AsThrown();
            ExceptionEventArgs target = new ExceptionEventArgs(exception);
            Boolean value = true;

            target.BubbleException = value;
            Assert.AreEqual(value, target.BubbleException);
        }
开发者ID:cegreer,项目名称:Common,代码行数:9,代码来源:ExceptionEventArgsTests.cs


示例7: BitmapDownloadFailed

        private void BitmapDownloadFailed(object sender, ExceptionEventArgs e)
        {
            var bitmap = (BitmapSource)sender;

            bitmap.DownloadCompleted -= BitmapDownloadCompleted;
            bitmap.DownloadFailed -= BitmapDownloadFailed;

            Image.Source = null;
        }
开发者ID:huoxudong125,项目名称:XamlMapControl,代码行数:9,代码来源:Tile.WPF.cs


示例8: BitmapDownloadFailed

        private void BitmapDownloadFailed(object sender, ExceptionEventArgs e)
        {
            var bitmap = (BitmapSource)sender;

            bitmap.DownloadCompleted -= BitmapDownloadCompleted;
            bitmap.DownloadFailed -= BitmapDownloadFailed;

            ((MapImage)Children[currentImageIndex]).Source = null;
            BlendImages();
        }
开发者ID:bhanu475,项目名称:XamlMapControl,代码行数:10,代码来源:MapImageLayer.WPF.cs


示例9: bmp_DownloadFailed

        void bmp_DownloadFailed(object sender, ExceptionEventArgs e)
        {
            BitmapFrame bmp = (BitmapFrame)sender;
            var id = downloadingTiles[bmp];
            downloadingTiles.Remove(bmp);
            UnsubscribeBitmapEvents(bmp);
            bmp.Freeze();

            ReportFailure(id);
        }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:10,代码来源:InternetCacheServer.cs


示例10: OnNonFatalError

 /// <summary>
 /// Handles non-fatal errors by writing a message describing the exception or
 /// failure to stderror.
 /// </summary>
 /// <param name="sender">Source of the error</param>
 /// <param name="e">Specifics of the exception or failure</param>
 internal static void OnNonFatalError(Object sender, ExceptionEventArgs e)
 {
     if (e.Exception != null)
     {
         Console.Error.WriteLine("Non-fatal exception: {0}", e.Exception.Message);
     }
     else
     {
         Console.Error.WriteLine("Non-fatal failure: {0}", e.Failure.Message);
     }
 }
开发者ID:spraints,项目名称:svn2tfs,代码行数:17,代码来源:Program.cs


示例11: FileLoader_FileLoadFailed

 void FileLoader_FileLoadFailed(object sender, ExceptionEventArgs e)
 {
     if (e.Exception != null)
     {
         OnGetConfigurationStoreFailed(new ExceptionEventArgs(e.Exception, e.UserState));
     }
     else
     {
         OnGetConfigurationStoreFailed(new ExceptionEventArgs(new Exception(Resources.Strings.ExceptionUnknownError), e.UserState));
     }
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:11,代码来源:FileConfigurationStoreProvider.cs


示例12: LocalCrashHandler

 private static void LocalCrashHandler(object sender, ExceptionEventArgs args)
 {
     var exception = args.ErrorException;
     var recoverable = exception as RecoverableException;
     if(recoverable != null)
     {
         MessageDialog.ShowError(args.ErrorException.Message);
     }
     else
     {
         MessageDialog.ShowWarning(args.ErrorException.ToString());
     }           
 }
开发者ID:bhuvanchandra,项目名称:emul8,代码行数:13,代码来源:XwtProvider.cs


示例13: ExceptionEventArgs_Integration_Serialization_Optimal

        public void ExceptionEventArgs_Integration_Serialization_Optimal()
        {
            Exception exception = new ApplicationException("This is a test.").AsThrown();
            Boolean bubbleException = true;
            ExceptionEventArgs original = new ExceptionEventArgs(exception, bubbleException);

            ExceptionEventArgs clone = original.SerializeBinary();
            Assert.AreNotSame(original, clone);
            Assert.AreEqual(original.BubbleException, clone.BubbleException);
            Assert.AreEqual(original.Exception.GetType(), clone.Exception.GetType());
            Assert.AreEqual(original.Exception.Message, clone.Exception.Message);
            Assert.AreEqual(original.Exception.StackTrace, clone.Exception.StackTrace);
        }
开发者ID:cegreer,项目名称:Common,代码行数:13,代码来源:ExceptionEventArgsTests.cs


示例14: OnBackgroundOpenReadAsyncFailed

 protected virtual void OnBackgroundOpenReadAsyncFailed(ExceptionEventArgs args)
 {
     if (BackgroundOpenReadAsyncFailed != null)
     {
         if (ESRI.ArcGIS.Client.Extensibility.MapApplication.Current != null)
         {
             ESRI.ArcGIS.Client.Extensibility.MapApplication.Current.Dispatcher.BeginInvoke((Action)delegate
             {
                 BackgroundOpenReadAsyncFailed(this, args);
             });
         }
         else
             BackgroundOpenReadAsyncFailed(this, args);
     }
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:15,代码来源:WebClientHelper.cs


示例15: SymbolConfigProvider_GetDefaultSymbolFailed

        void SymbolConfigProvider_GetDefaultSymbolFailed(object sender, ExceptionEventArgs e)
        {
            GraphicsLayer layer = e.UserState as GraphicsLayer;
            if (layer == null)
                return;

            if (Core.LayerExtensions.GetRunLayerPostInitializationActions(layer))
            {
                PerformPostLayerInitializationActions(layer, true);
                Core.LayerExtensions.SetRunLayerPostInitializationActions(layer, false);
                return;
            }

            AddLayer(layer, true, null);
        }
开发者ID:yulifengwx,项目名称:arcgis-viewer-silverlight,代码行数:15,代码来源:View_SymbologyLogic.cs


示例16: FileLoader_FileLoadFailed

 void FileLoader_FileLoadFailed(object sender, ExceptionEventArgs e)
 {
     object[] userState = (e.UserState as object[]);
     if (userState == null || userState.Length < 2)
         return;
     EventHandler<ExceptionEventArgs> onFailed = userState[2] as EventHandler<ExceptionEventArgs>;
     if (onFailed == null)
         return;
     if (e.Exception != null)
     {
         onFailed(this, new ExceptionEventArgs(e.Exception, userState[0]));
     }
     else
     {
         onFailed(this, new ExceptionEventArgs(new Exception(Resources.Strings.ExceptionUnknownError), e.UserState));
     }
 }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:17,代码来源:FileConfigurationProvider.cs


示例17: Runtime_UnhandledException

 void Runtime_UnhandledException(object sender, ExceptionEventArgs args)
 {
     switch (args.Severity)
     {
         case ExceptionSeverityLevel.Info:
             EventLog.WriteEntry(args.Exception.ToString(), EventLogEntryType.Information);
             break;
         case ExceptionSeverityLevel.Warning:
             EventLog.WriteEntry(args.Exception.ToString(), EventLogEntryType.Warning);
             break;
         case ExceptionSeverityLevel.Error:
             EventLog.WriteEntry(args.Exception.ToString(), EventLogEntryType.Error);
             break;
         case ExceptionSeverityLevel.Fatal:
             EventLog.WriteEntry(args.Exception.ToString(), EventLogEntryType.FailureAudit);
             break;
     }
 }
开发者ID:wasabii,项目名称:UcmaKit,代码行数:18,代码来源:RtcService.cs


示例18: RaisePausedEvents

		/// <summary> Sets up the eviroment and raises user events </summary>
		internal void RaisePausedEvents()
		{
			AssertPaused();
			DisableAllSteppers();
			CheckSelectedStackFrames();
			SelectMostRecentStackFrameWithLoadedSymbols();
			
			if (this.PauseSession.PausedReason == PausedReason.Exception) {
				ExceptionEventArgs args = new ExceptionEventArgs(this, this.SelectedThread.CurrentException, this.SelectedThread.CurrentExceptionType, this.SelectedThread.CurrentExceptionIsUnhandled);
				OnExceptionThrown(args);
				// The event could have resumed or killed the process
				if (this.IsRunning || this.TerminateCommandIssued || this.HasExited) return;
			}
			
			while(BreakpointHitEventQueue.Count > 0) {
				Breakpoint breakpoint = BreakpointHitEventQueue.Dequeue();
				breakpoint.NotifyHit();
				// The event could have resumed or killed the process
				if (this.IsRunning || this.TerminateCommandIssued || this.HasExited) return;
			}
			
			OnPaused();
			// The event could have resumed the process
			if (this.IsRunning || this.TerminateCommandIssued || this.HasExited) return;
		}
开发者ID:AdamLStevenson,项目名称:SharpDevelop,代码行数:26,代码来源:Process.cs


示例19: OnExceptionThrown

		protected internal virtual void OnExceptionThrown(ExceptionEventArgs e)
		{
			TraceMessage ("Debugger event: OnExceptionThrown()");
			if (ExceptionThrown != null) {
				ExceptionThrown(this, e);
			}
		}
开发者ID:AdamLStevenson,项目名称:SharpDevelop,代码行数:7,代码来源:Process.cs


示例20: Session_ErrorOccured

 private void Session_ErrorOccured(object sender, ExceptionEventArgs e)
 {
     this.RaiseError(e.Exception);
 }
开发者ID:splitice,项目名称:SSHKeyTransfer,代码行数:4,代码来源:SubsystemSession.cs



注:本文中的ExceptionEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ExceptionHandler类代码示例发布时间:2022-05-24
下一篇:
C# ExceptionDelegate类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap