MessageBox.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //
  2. // System.Windows.Forms.MessageBox.cs
  3. //
  4. // Author:
  5. // stubbed out by Paul Osman ([email protected])
  6. // Dennis Hayes ([email protected])
  7. // WINELib implementation started by John Sohn ([email protected])
  8. //
  9. // (C) 2002 Ximian, Inc
  10. //
  11. using System;
  12. using System.Reflection;
  13. using System.Globalization;
  14. //using System.Windows.Forms.AccessibleObject.IAccessible;
  15. using System.Drawing;
  16. namespace System.Windows.Forms {
  17. /// <summary>
  18. /// Most items complete
  19. /// </summary>
  20. public class MessageBox {
  21. //
  22. // -- Public Methods
  23. //
  24. [MonoTODO]
  25. public override bool Equals(object o)
  26. {
  27. throw new NotImplementedException ();
  28. }
  29. //public static bool Equals(object o1, object o2)
  30. //{
  31. // throw new NotImplementedException ();
  32. //}
  33. [MonoTODO]
  34. public override int GetHashCode()
  35. {
  36. //FIXME add our proprities
  37. return base.GetHashCode();
  38. }
  39. //public Type GetType() {
  40. // throw new NotImplementedException ();
  41. //}
  42. public static DialogResult Show(string text)
  43. {
  44. return (DialogResult)
  45. Win32.MessageBoxA ((IntPtr) 0, text, "",
  46. Win32.MB_OK);
  47. }
  48. public static DialogResult Show (IWin32Window w, string text)
  49. {
  50. return (DialogResult)
  51. Win32.MessageBoxA (w.Handle, text, "",
  52. Win32.MB_OK);
  53. }
  54. public static DialogResult Show (string text, string caption)
  55. {
  56. return (DialogResult)
  57. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  58. Win32.MB_OK);
  59. }
  60. public static DialogResult Show (IWin32Window w, string text,
  61. string caption)
  62. {
  63. return (DialogResult)
  64. Win32.MessageBoxA (w.Handle, text, caption,
  65. Win32.MB_OK);
  66. }
  67. public static DialogResult Show (string text, string caption,
  68. MessageBoxButtons mb)
  69. {
  70. return (DialogResult)
  71. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  72. (uint) mb);
  73. }
  74. public static DialogResult Show (
  75. IWin32Window w, string text,
  76. string caption, MessageBoxButtons mb)
  77. {
  78. return (DialogResult)
  79. Win32.MessageBoxA (w.Handle, text, caption,
  80. (uint) mb);
  81. }
  82. public static DialogResult Show (
  83. string text, string caption, MessageBoxButtons mb,
  84. MessageBoxIcon mi)
  85. {
  86. return (DialogResult)
  87. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  88. (uint) (mb | mi) );
  89. }
  90. public static DialogResult Show (
  91. IWin32Window w, string text, string caption,
  92. MessageBoxButtons mb, MessageBoxIcon mi)
  93. {
  94. return (DialogResult)
  95. Win32.MessageBoxA (w.Handle, text, caption,
  96. (uint) (mb | mi) );
  97. }
  98. public static DialogResult Show (
  99. string text, string caption, MessageBoxButtons mb,
  100. MessageBoxIcon mi, MessageBoxDefaultButton md)
  101. {
  102. return (DialogResult)
  103. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  104. (uint) (mb | mi | md) );
  105. }
  106. public static DialogResult Show (
  107. IWin32Window w, string text, string caption,
  108. MessageBoxButtons mb, MessageBoxIcon mi,
  109. MessageBoxDefaultButton md)
  110. {
  111. return (DialogResult)
  112. Win32.MessageBoxA (w.Handle, text, caption,
  113. (uint) (mb | mi | md) );
  114. }
  115. public static DialogResult
  116. Show (string text, string caption,
  117. MessageBoxButtons mb, MessageBoxIcon mi,
  118. MessageBoxDefaultButton md, MessageBoxOptions mo)
  119. {
  120. return (DialogResult)
  121. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  122. (uint) (mb | mi | md | mo) );
  123. }
  124. public static DialogResult Show (
  125. IWin32Window w, string text, string caption,
  126. MessageBoxButtons mb, MessageBoxIcon mi,
  127. MessageBoxDefaultButton md, MessageBoxOptions mo)
  128. {
  129. return (DialogResult)
  130. Win32.MessageBoxA (w.Handle, text, caption,
  131. (uint) (mb | mi | md | mo) );
  132. }
  133. [MonoTODO]
  134. public override string ToString () {
  135. throw new NotImplementedException ();
  136. }
  137. [MonoTODO]
  138. ~MessageBox () {
  139. throw new NotImplementedException ();
  140. }
  141. [MonoTODO]
  142. protected object MemberWiseClone () {
  143. throw new NotImplementedException ();
  144. }
  145. }
  146. }