MessageBox.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. //Compact Framework
  25. [MonoTODO]
  26. public override bool Equals(object o)
  27. {
  28. throw new NotImplementedException ();
  29. }
  30. //public static bool Equals(object o1, object o2)
  31. //{
  32. // throw new NotImplementedException ();
  33. //}
  34. //Compact Framework
  35. [MonoTODO]
  36. public override int GetHashCode()
  37. {
  38. //FIXME add our proprities
  39. return base.GetHashCode();
  40. }
  41. //Compact Framework
  42. //public Type GetType() {
  43. // throw new NotImplementedException ();
  44. //}
  45. //Compact Framework
  46. public static DialogResult Show(string text)
  47. {
  48. return (DialogResult)
  49. Win32.MessageBoxA ((IntPtr) 0, text, "",
  50. Win32.MB_OK);
  51. }
  52. public static DialogResult Show (IWin32Window w, string text)
  53. {
  54. return (DialogResult)
  55. Win32.MessageBoxA (w.Handle, text, "",
  56. Win32.MB_OK);
  57. }
  58. //Compact Framework
  59. public static DialogResult Show (string text, string caption)
  60. {
  61. return (DialogResult)
  62. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  63. Win32.MB_OK);
  64. }
  65. public static DialogResult Show (IWin32Window w, string text,
  66. string caption)
  67. {
  68. return (DialogResult)
  69. Win32.MessageBoxA (w.Handle, text, caption,
  70. Win32.MB_OK);
  71. }
  72. public static DialogResult Show (string text, string caption,
  73. MessageBoxButtons mb)
  74. {
  75. return (DialogResult)
  76. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  77. (uint) mb);
  78. }
  79. public static DialogResult Show (
  80. IWin32Window w, string text,
  81. string caption, MessageBoxButtons mb)
  82. {
  83. return (DialogResult)
  84. Win32.MessageBoxA (w.Handle, text, caption,
  85. (uint) mb);
  86. }
  87. public static DialogResult Show (
  88. string text, string caption, MessageBoxButtons mb,
  89. MessageBoxIcon mi)
  90. {
  91. return (DialogResult)
  92. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  93. (uint) (mb | mi) );
  94. }
  95. public static DialogResult Show (
  96. IWin32Window w, string text, string caption,
  97. MessageBoxButtons mb, MessageBoxIcon mi)
  98. {
  99. return (DialogResult)
  100. Win32.MessageBoxA (w.Handle, text, caption,
  101. (uint) (mb | mi) );
  102. }
  103. //Compact Framework
  104. public static DialogResult Show (
  105. string text, string caption, MessageBoxButtons mb,
  106. MessageBoxIcon mi, MessageBoxDefaultButton md)
  107. {
  108. return (DialogResult)
  109. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  110. (uint) (mb | mi | md) );
  111. }
  112. public static DialogResult Show (
  113. IWin32Window w, string text, string caption,
  114. MessageBoxButtons mb, MessageBoxIcon mi,
  115. MessageBoxDefaultButton md)
  116. {
  117. return (DialogResult)
  118. Win32.MessageBoxA (w.Handle, text, caption,
  119. (uint) (mb | mi | md) );
  120. }
  121. public static DialogResult
  122. Show (string text, string caption,
  123. MessageBoxButtons mb, MessageBoxIcon mi,
  124. MessageBoxDefaultButton md, MessageBoxOptions mo)
  125. {
  126. return (DialogResult)
  127. Win32.MessageBoxA ((IntPtr) 0, text, caption,
  128. (uint) (mb | mi | md | mo) );
  129. }
  130. public static DialogResult Show (
  131. IWin32Window w, string text, string caption,
  132. MessageBoxButtons mb, MessageBoxIcon mi,
  133. MessageBoxDefaultButton md, MessageBoxOptions mo)
  134. {
  135. return (DialogResult)
  136. Win32.MessageBoxA (w.Handle, text, caption,
  137. (uint) (mb | mi | md | mo) );
  138. }
  139. //Compact Framework
  140. [MonoTODO]
  141. public override string ToString () {
  142. throw new NotImplementedException ();
  143. }
  144. //Compact Framework
  145. [MonoTODO]
  146. ~MessageBox () {
  147. throw new NotImplementedException ();
  148. }
  149. //Compact Framework
  150. [MonoTODO]
  151. protected object MemberWiseClone () {
  152. throw new NotImplementedException ();
  153. }
  154. }
  155. }