public static void ShowResultDialog(this ProgressMonitor monitor, MonoDevelop.Components.Window parent) { if (monitor.Errors.Length == 1 && !monitor.HasWarnings) { MessageService.ShowError(parent, monitor.Errors [0].Message, null, monitor.Errors [0].Exception); } else if (!monitor.HasErrors && monitor.Warnings.Length == 1) { MessageService.ShowWarning(parent, monitor.Warnings[0]); } else if (monitor.HasErrors || monitor.HasWarnings) { using (var resultDialog = new MultiMessageDialog() { Modal = true, }) { foreach (var m in monitor.Errors) { resultDialog.AddError(m.DisplayMessage); } foreach (var m in monitor.Warnings) { resultDialog.AddWarning(m); } MessageService.ShowCustomDialog(resultDialog, parent); } } }
public static void SetParentToWindow(this Gtk.Window window, MonoDevelop.Components.Window parent) { try { #if MAC if (parent.TryGetNativeWidget <NSWindow> (out var nsWindow)) { var myNSWindow = MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow(window); myNSWindow.ParentWindow = nsWindow; } else { window.TransientFor = parent; } #else window.TransientFor = parent; #endif } catch (Exception e) { LoggingService.LogInternalError("Error while setting parent.", e); } }
public static IntPtr HgdiobjGet(MonoDevelop.Components.Window window) { Gtk.Window gtkWindow = window; return(HgdiobjGet(gtkWindow.GdkWindow)); }