OperationAbortedException.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. namespace System.Data {
  9. using System;
  10. using System.Data;
  11. using System.Data.Common;
  12. using System.Diagnostics;
  13. using System.Globalization;
  14. using System.Runtime.Serialization;
  15. [Serializable]
  16. public sealed class OperationAbortedException : SystemException {
  17. private OperationAbortedException(string message, Exception innerException) : base(message, innerException) {
  18. HResult = HResults.OperationAborted;
  19. }
  20. private OperationAbortedException(SerializationInfo si, StreamingContext sc) : base(si, sc) {
  21. }
  22. static internal OperationAbortedException Aborted(Exception inner) {
  23. OperationAbortedException e;
  24. if (inner == null) {
  25. e = new OperationAbortedException(Res.GetString(Res.ADP_OperationAborted), null);
  26. }
  27. else {
  28. e = new OperationAbortedException(Res.GetString(Res.ADP_OperationAbortedExceptionMessage), inner);
  29. }
  30. ADP.TraceExceptionAsReturnValue(e);
  31. return e;
  32. }
  33. }
  34. }