}
// Both calls are needed, one is for the WM, the other for our focus logic
- XplatUI.Activate(form.form_parent_window.window.Handle);
+ XplatUI.Activate(form.window.Handle);
form.Activate();
while (control.MoveNext()) {
if ((((Control)control.Current).parent == null) && (((Control)control.Current).is_visible) && (((Control)control.Current).is_enabled)) {
- if ((control.Current is Form.FormParentWindow) && (((Form.FormParentWindow)control.Current)!=form.form_parent_window)) {
+ if ((control.Current is Form) && (((Form)control.Current)!=form)) {
XplatUI.EnableWindow(((Control)control.Current).window.Handle, false);
toplevels.Enqueue((Control)control.Current);
}
form.CreateControl();
while (!exiting && !form.end_modal && XplatUI.GetMessage(ref msg, IntPtr.Zero, 0, 0)) {
+ if ((message_filters != null) && (message_filters.Count > 0)) {
+ Message m;
+ bool drop;
+
+ drop = false;
+ m = new Message();
+ m.Msg = (int)msg.message;
+ m.HWnd = msg.hwnd;
+ m.LParam = msg.lParam;
+ m.WParam = msg.wParam;
+ for (int i = 0; i < message_filters.Count; i++) {
+ if (((IMessageFilter)message_filters[i]).PreFilterMessage(ref m)) {
+ // we're dropping the message
+ drop = true;
+ break;
+ }
+ }
+ if (drop) {
+ continue;
+ }
+ }
+
XplatUI.TranslateMessage(ref msg);
XplatUI.DispatchMessage(ref msg);
public static string CompanyName {
get {
- StackTrace st;
-
- if (Environment.OSVersion.Platform != (PlatformID)128) {
- RegistryKey key;
- String ret;
-
- key=Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion", false);
- ret=(String)key.GetValue("RegisteredOrganization");
-
- return ret;
-
+ AssemblyCompanyAttribute[] attrs = (AssemblyCompanyAttribute[]) Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), true);
+
+ if ((attrs != null) && attrs.Length>0) {
+ return attrs[0].Company;
}
- st=new StackTrace();
- return st.GetFrame(st.FrameCount-1).GetMethod().DeclaringType.Namespace;
+ return Assembly.GetEntryAssembly().GetName().Name;
}
}
public static string LocalUserAppDataPath {
get {
- return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+ return Path.Combine(Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), CompanyName), ProductName), ProductVersion);
}
}
public static string UserAppDataPath {
get {
- return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+ return Path.Combine(Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), CompanyName), ProductName), ProductVersion);
}
}
XplatUI.EnableThemes();
}
+#if NET_2_0
+ public static void EnableRTLMirroring ()
+ {
+ }
+#endif
+
public static void Exit() {
XplatUI.Exit();
}
if (form != null) {
// Both calls are needed, one is for the WM, the other for our focus logic
- XplatUI.Activate(form.form_parent_window.window.Handle);
+ XplatUI.Activate(form.window.Handle);
form.Activate();
}
messageloop_started = true;
while (!exiting && XplatUI.GetMessage(ref msg, IntPtr.Zero, 0, 0)) {
+ if ((message_filters != null) && (message_filters.Count > 0)) {
+ Message m;
+ bool drop;
+
+ drop = false;
+ m = new Message();
+ m.Msg = (int)msg.message;
+ m.HWnd = msg.hwnd;
+ m.LParam = msg.lParam;
+ m.WParam = msg.wParam;
+ for (int i = 0; i < message_filters.Count; i++) {
+ if (((IMessageFilter)message_filters[i]).PreFilterMessage(ref m)) {
+ // we're dropping the message
+ drop = true;
+ break;
+ }
+ }
+ if (drop) {
+ continue;
+ }
+ }
+
XplatUI.TranslateMessage(ref msg);
XplatUI.DispatchMessage(ref msg);