(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / MessageBox.cs
blob3d7a9597f545d782fac945fdec43b18e2d8eff36
1 //
2 // System.Windows.Forms.MessageBox.cs
3 //
4 // Author:
5 // stubbed out by Paul Osman (paul.osman@sympatico.ca)
6 // Dennis Hayes (dennish@Raytek.com)
7 // WINELib implementation started by John Sohn (jsohn@columbus.rr.com)
8 //
9 // (C) 2002/3 Ximian, Inc
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System;
34 using System.Reflection;
35 using System.Globalization;
36 //using System.Windows.Forms.AccessibleObject.IAccessible;
37 using System.Drawing;
39 namespace System.Windows.Forms {
41 /// <summary>
42 /// Most items complete
43 /// </summary>
44 public class MessageBox {
46 private MessageBox(){//For signiture compatablity. Prevents the auto creation of public constructor
50 // -- Public Methods
53 //Compact Framework
54 public static DialogResult Show(string text)
56 return (DialogResult)
57 Win32.MessageBoxA ((IntPtr) 0, text, "", (uint)(WB_MessageBox_Types.MB_OK | WB_MessageBox_Types.MB_TASKMODAL));
60 public static DialogResult Show (IWin32Window owner, string text)
62 return (DialogResult)
63 Win32.MessageBoxA (owner.Handle, text, "", (uint)WB_MessageBox_Types.MB_OK);
66 //Compact Framework
67 public static DialogResult Show (string text, string caption)
69 return (DialogResult)
70 Win32.MessageBoxA ((IntPtr) 0, text, caption, (uint)WB_MessageBox_Types.MB_OK);
73 public static DialogResult Show (IWin32Window owner, string text, string caption)
75 return (DialogResult)
76 Win32.MessageBoxA (owner.Handle, text, caption, (uint)WB_MessageBox_Types.MB_OK);
79 public static DialogResult Show (string text, string caption,
80 MessageBoxButtons buttons)
82 return (DialogResult)
83 Win32.MessageBoxA ((IntPtr) 0, text, caption, (uint) buttons);
86 public static DialogResult Show (
87 IWin32Window owner, string text,
88 string caption, MessageBoxButtons buttons)
90 return (DialogResult)
91 Win32.MessageBoxA (owner.Handle, text, caption, (uint) buttons);
94 public static DialogResult Show (
95 string text, string caption, MessageBoxButtons buttons,
96 MessageBoxIcon icon)
98 return (DialogResult)
99 Win32.MessageBoxA ((IntPtr) 0, text, caption,
100 (uint) ((uint)buttons | (uint)icon) );
103 public static DialogResult Show (
104 IWin32Window owner, string text, string caption,
105 MessageBoxButtons buttons, MessageBoxIcon icon)
107 return (DialogResult)
108 Win32.MessageBoxA (owner.Handle, text, caption,
109 (uint) ((uint)buttons |(uint) icon) );
112 //Compact Framework
113 public static DialogResult Show (
114 string text, string caption, MessageBoxButtons buttons,
115 MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
117 return (DialogResult)
118 Win32.MessageBoxA ((IntPtr) 0, text, caption,
119 (uint) ((uint)buttons | (uint)icon | (uint)defaultButton) );
123 public static DialogResult Show (
124 IWin32Window owner, string text, string caption,
125 MessageBoxButtons buttons, MessageBoxIcon icon,
126 MessageBoxDefaultButton defaultButton)
128 return (DialogResult)
129 Win32.MessageBoxA (owner.Handle, text, caption,
130 (uint) ((uint)buttons | (uint)icon | (uint)defaultButton) );
133 public static DialogResult
134 Show (string text, string caption,
135 MessageBoxButtons buttons, MessageBoxIcon icon,
136 MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
138 return (DialogResult)
139 Win32.MessageBoxA ((IntPtr) 0, text, caption,
140 (uint) ((uint)buttons | (uint)icon | (uint)defaultButton |(uint) options) );
143 public static DialogResult Show (
144 IWin32Window owner, string text, string caption,
145 MessageBoxButtons buttons, MessageBoxIcon icon,
146 MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
148 return (DialogResult)
149 Win32.MessageBoxA (owner.Handle, text, caption,
150 (uint) ((uint)buttons | (uint)icon | (uint)defaultButton | (uint)options) );