本文整理匯總了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 ());
}
示例2: OnDisconnectError
private static void OnDisconnectError(AggregateException ex, object state)
{
((TraceSource)state).TraceEvent(TraceEventType.Error, 0, "Failed to raise disconnect: " + ex.GetBaseException());
}
示例3: OnKeepAliveError
private static void OnKeepAliveError(AggregateException ex, object state)
{
((TraceSource)state).TraceEvent(TraceEventType.Error, 0, "Failed to send keep alive: " + ex.GetBaseException());
}
示例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");
}
示例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());
}