Win32Exception.cs 919 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // System.ComponentModel.cs
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) 2001 Ximian, Inc. http://www.ximian.com
  8. //
  9. using System.Runtime.InteropServices;
  10. using System.Runtime.Serialization;
  11. using System.Globalization;
  12. namespace System.ComponentModel {
  13. public class Win32Exception : ExternalException {
  14. int native_error_code;
  15. // Constructors
  16. public Win32Exception ()
  17. : base (Locale.GetText ("Win32 exception"))
  18. {
  19. }
  20. public Win32Exception (string message)
  21. : base (message)
  22. {
  23. }
  24. protected Win32Exception(SerializationInfo info, StreamingContext context)
  25. : base (info, context) {
  26. }
  27. public Win32Exception (string message, Exception inner)
  28. : base (message, inner)
  29. {
  30. }
  31. public Win32Exception (string message, int errorCode)
  32. {
  33. native_error_code = errorCode;
  34. }
  35. public int NativeErrorCode {
  36. get {
  37. return native_error_code;
  38. }
  39. }
  40. }
  41. }