Fix pragma warning restore (dotnet/coreclr#26389)
[mono-project.git] / netcore / System.Private.CoreLib / shared / System / OutOfMemoryException.cs
blob0a079959343d2bf3b95c2465c5b5615cf7890770
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System.Runtime.Serialization;
7 namespace System
9 /// <summary>
10 /// The exception class for OOM.
11 /// </summary>
12 [Serializable]
13 [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
14 public class OutOfMemoryException : SystemException
16 public OutOfMemoryException() : base(
17 #if CORECLR
18 GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory)
19 #else
20 SR.Arg_OutOfMemoryException
21 #endif
24 HResult = HResults.COR_E_OUTOFMEMORY;
27 public OutOfMemoryException(string? message)
28 : base(message)
30 HResult = HResults.COR_E_OUTOFMEMORY;
33 public OutOfMemoryException(string? message, Exception? innerException)
34 : base(message, innerException)
36 HResult = HResults.COR_E_OUTOFMEMORY;
39 protected OutOfMemoryException(SerializationInfo info, StreamingContext context) : base(info, context)