當前位置: 首頁>>代碼示例>>C#>>正文


C# AggregateException.GetBaseException方法代碼示例

本文整理匯總了C#中AggregateException.GetBaseException方法的典型用法代碼示例。如果您正苦於以下問題:C# AggregateException.GetBaseException方法的具體用法?C# AggregateException.GetBaseException怎麽用?C# AggregateException.GetBaseException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AggregateException的用法示例。


在下文中一共展示了AggregateException.GetBaseException方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SimpleInnerExceptionTestCase

		public void SimpleInnerExceptionTestCase ()
		{
			var message = "Foo";
			var inner = new ApplicationException (message);
			var ex = new AggregateException (inner);

			Assert.IsNotNull (ex.InnerException);
			Assert.IsNotNull (ex.InnerExceptions);

			Assert.AreEqual (inner, ex.InnerException);
			Assert.AreEqual (1, ex.InnerExceptions.Count);
			Assert.AreEqual (inner, ex.InnerExceptions[0]);
			Assert.AreEqual (message, ex.InnerException.Message);
			Assert.AreEqual (inner, ex.GetBaseException ());
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:15,代碼來源:AggregateExceptionTests.cs

示例2: OnDisconnectError

 private static void OnDisconnectError(AggregateException ex, object state)
 {
     ((TraceSource)state).TraceEvent(TraceEventType.Error, 0, "Failed to raise disconnect: " + ex.GetBaseException());
 }
開發者ID:Choulla-Naresh8264,項目名稱:SignalR,代碼行數:4,代碼來源:TransportDisconnectBase.cs

示例3: OnKeepAliveError

 private static void OnKeepAliveError(AggregateException ex, object state)
 {
     ((TraceSource)state).TraceEvent(TraceEventType.Error, 0, "Failed to send keep alive: " + ex.GetBaseException());
 }
開發者ID:GaneshBachhao,項目名稱:SignalR,代碼行數:4,代碼來源:TransportHeartBeat.cs

示例4: GetBaseWithInner

		public void GetBaseWithInner ()
		{
			var ae = new AggregateException ("x", new [] { new ArgumentException (), new ArgumentNullException () });
			Assert.AreEqual (ae, ae.GetBaseException (), "#1");

			var expected = new ArgumentException ();
			var ae2 = new AggregateException ("x", new AggregateException (expected, new Exception ()));
			Assert.AreEqual (expected, ae2.GetBaseException ().InnerException, "#2");
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:9,代碼來源:AggregateExceptionTests.cs

示例5: OnDisconnectError

 private static void OnDisconnectError(AggregateException ex, object state)
 {
     ((ILogger)state).LogError("Failed to raise disconnect: " + ex.GetBaseException());
 }
開發者ID:FabianGosebrink,項目名稱:ASPNET-Core-Angular2-SignalR-Typescript,代碼行數:4,代碼來源:TransportDisconnectBase.cs

示例6: OnKeepAliveError

 private static void OnKeepAliveError(AggregateException ex, object state)
 {
     ((ILogger)state).LogError("Failed to send keep alive: " + ex.GetBaseException());
 }
開發者ID:REALTOBIZ,項目名稱:SignalR-Server,代碼行數:4,代碼來源:TransportHeartBeat.cs


注:本文中的AggregateException.GetBaseException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。