Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Data / System / Data / OperationAbortedException.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="OperationAbortedException.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">[....]</owner>
6 // <owner current="true" primary="false">[....]</owner>
7 //------------------------------------------------------------------------------
8
9 namespace System.Data {
10
11     using System;
12     using System.Data;
13     using System.Data.Common;
14     using System.Diagnostics;
15     using System.Globalization;
16     using System.Runtime.Serialization;
17
18     [Serializable]
19     public sealed class OperationAbortedException : SystemException {
20         private OperationAbortedException(string message, Exception innerException) : base(message, innerException) {
21             HResult = HResults.OperationAborted;
22         }
23
24         private OperationAbortedException(SerializationInfo si, StreamingContext sc) : base(si, sc) {
25         }
26
27         static internal OperationAbortedException Aborted(Exception inner) {
28             OperationAbortedException e;
29             if (inner == null) {
30                 e = new OperationAbortedException(Res.GetString(Res.ADP_OperationAborted), null);
31             }
32             else {
33                 e = new OperationAbortedException(Res.GetString(Res.ADP_OperationAbortedExceptionMessage), inner);
34             }
35             ADP.TraceExceptionAsReturnValue(e);
36             return e;
37         }
38     }
39 }