当前位置: 首页>>代码示例>>C#>>正文


C# ExceptionEventArgs类代码示例

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


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


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