Ejemplo n.º 1
0
        static Command GenericAlert(WindowFrame parent, MessageDescription message)
        {
            if (message.ApplyToAllButton != null)
            {
                return(message.ApplyToAllButton);
            }

            IAlertDialogBackend backend = Toolkit.CurrentEngine.Backend.CreateBackend <IAlertDialogBackend> ();

            backend.Initialize(Toolkit.CurrentEngine.Context);
            if (message.Icon != null)
            {
                message.Icon.InitForToolkit(Toolkit.CurrentEngine);
            }

            using (backend) {
                Command res = null;
                Toolkit.CurrentEngine.InvokePlatformCode(delegate {
                    res = backend.Run(parent ?? RootWindow, message);
                });

                if (backend.ApplyToAll)
                {
                    message.ApplyToAllButton = res;
                }

                return(res);
            }
        }
Ejemplo n.º 2
0
 public Command Run(WindowFrame parent)
 {
     Toolkit.InvokePlatformCode(delegate {
         Backend.RunLoop((IWindowFrameBackend)WidgetRegistry.GetBackend(parent));
     });
     return(resultCommand);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        public bool Run(WindowFrame parentWindow)
        {
            var backend = Toolkit.CurrentEngine.Backend.CreateBackend <ISelectFontDialogBackend> ();

            if (backend == null)
            {
                backend = new DefaultSelectFontDialogBackend(parentWindow);
            }
            try {
                backend.SelectedFont = SelectedFont;
                backend.Title        = Title;
                backend.PreviewText  = PreviewText;
                bool result = false;
                Toolkit.CurrentEngine.InvokePlatformCode(delegate {
                    result = backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow));
                });
                return(result);
            } catch (Exception ex) {
                Console.WriteLine(ex);
                return(false);
            } finally {
                font = backend.SelectedFont;
                backend.Dispose();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        public bool Run(WindowFrame parentWindow)
        {
            try {
                running = true;
                Backend.Initialize(multiselect);
                if (!string.IsNullOrEmpty(currentFolder))
                {
                    Backend.CurrentFolder = currentFolder;
                }
                if (!string.IsNullOrEmpty(title))
                {
                    Backend.Title = title;
                }
                Backend.CanCreateFolders = canCreateFolders;

                bool result = false;
                BackendHost.ToolkitEngine.InvokePlatformCode(delegate {
                    result = Backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow));
                });
                return(result);
            } finally {
                currentFolder = Backend.CurrentFolder;
                folder        = Backend.Folder;
                folders       = Backend.Folders;
                currentFolder = Backend.CurrentFolder;
                running       = false;
                Backend.Cleanup();
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Shows the dialog.
 /// </summary>
 public bool Run(WindowFrame parentWindow)
 {
     try {
         running = true;
         Backend.Initialize(filters, multiselect, initialFileName);
         if (!string.IsNullOrEmpty(currentFolder))
         {
             Backend.CurrentFolder = currentFolder;
         }
         if (activeFilter != null)
         {
             Backend.ActiveFilter = activeFilter;
         }
         if (!string.IsNullOrEmpty(title))
         {
             Backend.Title = title;
         }
         return(Backend.Run((IWindowFrameBackend)BackendHost.ToolkitEngine.GetSafeBackend(parentWindow)));
     } finally {
         currentFolder = Backend.CurrentFolder;
         activeFilter  = Backend.ActiveFilter;
         fileName      = Backend.FileName;
         fileNames     = Backend.FileNames;
         currentFolder = Backend.CurrentFolder;
         running       = false;
         Backend.Cleanup();
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Shows the dialog.
 /// </summary>
 public bool Run(WindowFrame parentWindow)
 {
     try {
         running = true;
         Backend.Initialize(filters, multiselect, initialFileName);
         if (!string.IsNullOrEmpty(currentFolder))
         {
             Backend.CurrentFolder = currentFolder;
         }
         if (activeFilter != null)
         {
             Backend.ActiveFilter = activeFilter;
         }
         if (!string.IsNullOrEmpty(title))
         {
             Backend.Title = title;
         }
         bool result = false;
         BackendHost.ToolkitEngine.InvokePlatformCode(delegate {
             result = Backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow));
         });
         return(result);
     } finally {
         activeFilter = Backend.ActiveFilter;
         fileName     = Backend.FileName;
         fileNames    = Backend.FileNames;
         if (fileName != string.Empty)
         {
             currentFolder = Backend.CurrentFolder;
         }
         running = false;
         Backend.Cleanup();
     }
 }
Ejemplo n.º 7
0
 public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText, string title, Drawing.Image icon)
 {
     if (string.IsNullOrEmpty(title))
     {
         title = parent?.Title ?? Application.TranslationCatalog.GetString("Information");
     }
     GenericAlert(parent, icon, primaryText, secondaryText, title, Command.Ok);
 }
Ejemplo n.º 8
0
 public static void ShowError(WindowFrame parent, string primaryText, string secondaryText, string title)
 {
     if (string.IsNullOrEmpty(title))
     {
         title = parent?.Title ?? Application.TranslationCatalog.GetString("Error");
     }
     GenericAlert(parent, Toolkit.CurrentEngine.Defaults.MessageDialog.ErrorIcon, primaryText, secondaryText, title, Command.Ok);
 }
Ejemplo n.º 9
0
        public Command Run(WindowFrame parent)
        {
            BackendHost.ToolkitEngine.ValidateObject(parent);

            BackendHost.ToolkitEngine.InvokePlatformCode(delegate {
                Backend.RunLoop((IWindowFrameBackend)Toolkit.GetBackend(parent));
            });
            return(resultCommand);
        }
Ejemplo n.º 10
0
        public virtual Xwt.WindowFrame ShowTooltipWindow(MonoTextEditor editor, Xwt.WindowFrame tipWindow, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, MonoDevelop.Ide.Editor.TooltipItem item)
        {
            int    w;
            double xalign;

            GetRequiredPosition(editor, tipWindow, out w, out xalign);

            ShowAndPositionTooltip(editor, tipWindow, mouseX, mouseY, w, xalign);

            return(tipWindow);
        }
Ejemplo n.º 11
0
 public Popover(WindowFrame parent, Widget child, Position arrowPosition)
 {
     this.arrowPosition = arrowPosition;
     backend = WidgetRegistry.CreateBackend<IPopoverBackend> (GetType ());
     backend.Init ((IWindowFrameBackend) WidgetRegistry.GetBackend (parent),
                   (IWidgetBackend) WidgetRegistry.GetBackend (child), arrowPosition);
     backend.Closed += (sender, e) => {
         if (Closed != null)
             Closed (this, EventArgs.Empty);
     };
 }
Ejemplo n.º 12
0
		/// <summary>
		/// Shows the dialog.
		/// </summary>
		public bool Run (WindowFrame parentWindow)
		{
			var backend = Toolkit.CurrentEngine.Backend.CreateBackend<ISelectColorDialogBackend> ();
			try {
				if (color != Colors.Transparent)
					backend.Color = color;
				return backend.Run ((IWindowFrameBackend)Toolkit.CurrentEngine.GetSafeBackend (parentWindow), title, supportsAlpha);
			} finally {
				color = backend.Color;
				backend.Dispose ();
			}
		}
Ejemplo n.º 13
0
        public Command Run(WindowFrame parent)
        {
            if (parent != null)
            {
                TransientFor = parent;
            }
            AdjustSize();

            loopEnded = false;
            BackendHost.ToolkitEngine.InvokePlatformCode(delegate {
                Backend.RunLoop((IWindowFrameBackend)Toolkit.GetBackend(parent));
            });
            return(resultCommand);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        public bool Run(WindowFrame parentWindow)
        {
            var backend = WidgetRegistry.CreateBackend <ISelectColorDialogBackend> (GetType());

            try {
                if (color != Colors.Transparent)
                {
                    backend.Color = color;
                }
                return(backend.Run((IWindowFrameBackend)WidgetRegistry.GetBackend(parentWindow), title, supportsAlpha));
            } finally {
                color = backend.Color;
                backend.Dispose();
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        public bool Run(WindowFrame parentWindow)
        {
            var backend = Toolkit.CurrentEngine.Backend.CreateBackend <ISelectColorDialogBackend> ();

            try {
                if (color != Colors.Transparent)
                {
                    backend.Color = color;
                }
                return(backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow), title, supportsAlpha));
            } finally {
                color = backend.Color;
                backend.Dispose();
            }
        }
Ejemplo n.º 16
0
        static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, int defaultButton, params Command[] buttons)
        {
            GenericMessage message = new GenericMessage()
            {
                Icon          = icon,
                Text          = primaryText,
                SecondaryText = secondaryText,
                DefaultButton = defaultButton
            };

            foreach (Command but in buttons)
            {
                message.Buttons.Add(but);
            }

            return(GenericAlert(parent, message));
        }
Ejemplo n.º 17
0
        internal static void ShowAndPositionTooltip(MonoTextEditor editor, Xwt.WindowFrame tipWindow, int mouseX, int mouseY, int width, double xalign)
        {
            int ox = 0, oy = 0;

            if (editor.GdkWindow != null)
            {
                editor.GdkWindow.GetOrigin(out ox, out oy);
            }

            width += 10;

            int x = mouseX + ox + editor.Allocation.X;
            int y = mouseY + oy + editor.Allocation.Y;

            Gdk.Rectangle geometry = editor.Screen.GetUsableMonitorGeometry(editor.Screen.GetMonitorAtPoint(x, y));

            x -= (int)((double)width * xalign);
            y += 10;

            if (x + width >= geometry.X + geometry.Width)
            {
                x = geometry.X + geometry.Width - width;
            }
            if (x < geometry.Left)
            {
                x = geometry.Left;
            }

            int h = (int)tipWindow.Height;

            if (y + h >= geometry.Y + geometry.Height)
            {
                y = geometry.Y + geometry.Height - h;
            }
            if (y < geometry.Top)
            {
                y = geometry.Top;
            }

            tipWindow.Location = new Xwt.Point(x, y);

            tipWindow.Show();
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        public bool Run(WindowFrame parentWindow)
        {
            var backend = Toolkit.CurrentEngine.Backend.CreateBackend <ISelectColorDialogBackend> ();

            try {
                if (color != Colors.Transparent)
                {
                    backend.Color = color;
                }
                bool result = false;
                Toolkit.CurrentEngine.InvokePlatformCode(delegate {
                    result = backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow), title, supportsAlpha);
                });
                return(result);
            } finally {
                color = backend.Color;
                backend.Dispose();
            }
        }
Ejemplo n.º 19
0
        public DefaultSelectFontDialogBackend(WindowFrame parentWindow)
        {
            parent = parentWindow;

            fontDialog        = new Dialog();
            fontDialog.Width  = 500;
            fontDialog.Height = 300;

            VBox box = new VBox();

            fontSelector              = new FontSelector();
            fontSelector.FontChanged += (sender, e) => SelectedFont = fontSelector.SelectedFont;
            box.PackStart(fontSelector, true);

            fontDialog.Content = box;

            fontDialog.Buttons.Add(new DialogButton(Command.Cancel));
            fontDialog.Buttons.Add(new DialogButton(Command.Ok));
        }
Ejemplo n.º 20
0
        static Command GenericAlert(WindowFrame parent, MessageDescription message)
        {
            if (message.ApplyToAllButton != null)
            {
                return(message.ApplyToAllButton);
            }

            IAlertDialogBackend backend = WidgetRegistry.CreateBackend <IAlertDialogBackend> (typeof(IAlertDialogBackend));

            using (backend) {
                var res = backend.Run(parent ?? RootWindow, message);

                if (backend.ApplyToAll)
                {
                    message.ApplyToAllButton = res;
                }

                return(res);
            }
        }
Ejemplo n.º 21
0
        public RunConfigurationNameDialog(Xwt.WindowFrame parent, string name, Command action, IEnumerable <string> invalidNames)
        {
            TransientFor      = parent;
            Resizable         = false;
            Width             = 300;
            this.invalidNames = invalidNames;
            mainBox           = new VBox();
            var box = new HBox();

            mainBox.PackStart(box, true);
            box.PackStart(new Label(GettextCatalog.GetString("Name")), false);
            entry      = new TextEntry();
            entry.Text = name ?? "";
            box.PackStart(entry, true);
            Content = mainBox;

            Buttons.Add(new DialogButton(Command.Cancel));
            Buttons.Add(okButton = new DialogButton(action));
            this.DefaultCommand  = okButton.Command;
            entry.Activated     += Entry_Activated;
            entry.Changed       += (s, o) => UpdateControls();
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Shows the dialog.
 /// </summary>
 public bool Run(WindowFrame parentWindow)
 {
     try {
         running = true;
         Backend.Initialize(multiselect);
         if (!string.IsNullOrEmpty(currentFolder))
         {
             Backend.CurrentFolder = currentFolder;
         }
         if (!string.IsNullOrEmpty(title))
         {
             Backend.Title = title;
         }
         return(Backend.Run((IWindowFrameBackend)WidgetRegistry.GetBackend(parentWindow)));
     } finally {
         currentFolder = Backend.CurrentFolder;
         folder        = Backend.Folder;
         folders       = Backend.Folders;
         currentFolder = Backend.CurrentFolder;
         running       = false;
         Backend.Cleanup();
     }
 }
Ejemplo n.º 23
0
Archivo: Dialog.cs Proyecto: m13253/xwt
		public Command Run (WindowFrame parent)
		{
			BackendHost.ToolkitEngine.ValidateObject (parent);
			if (parent != null)
				TransientFor = parent;
			AdjustSize ();

			loopEnded = false;
			BackendHost.ToolkitEngine.InvokePlatformCode (delegate {
				Backend.RunLoop ((IWindowFrameBackend) Toolkit.GetBackend (parent));
			});
			return resultCommand;
		}
Ejemplo n.º 24
0
 /// <summary>
 /// Shows the dialog.
 /// </summary>
 public bool Run(WindowFrame parentWindow)
 {
     try {
         running = true;
         Backend.Initialize (filters, multiselect, initialFileName);
         if (!string.IsNullOrEmpty (currentFolder))
             Backend.CurrentFolder = currentFolder;
         if (activeFilter != null)
             Backend.ActiveFilter = activeFilter;
         if (!string.IsNullOrEmpty (title))
             Backend.Title = title;
         return Backend.Run ((IWindowFrameBackend)backendHost.ToolkitEngine.GetSafeBackend (parentWindow));
     } finally {
         currentFolder = Backend.CurrentFolder;
         activeFilter = Backend.ActiveFilter;
         fileName = Backend.FileName;
         fileNames = Backend.FileNames;
         currentFolder = Backend.CurrentFolder;
         running = false;
         Backend.Cleanup ();
     }
 }
Ejemplo n.º 25
0
 public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText)
 {
     GenericAlert(parent, StockIcons.Warning, primaryText, secondaryText, Command.Ok);
 }
Ejemplo n.º 26
0
 public static void ShowError(WindowFrame parent, string primaryText)
 {
     ShowError(parent, primaryText, null);
 }
Ejemplo n.º 27
0
 static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, params Command[] buttons)
 {
     return(GenericAlert(parent, icon, primaryText, secondaryText, buttons.Length - 1, buttons));
 }
Ejemplo n.º 28
0
 public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText)
 {
     ShowMessage(parent, StockIcons.Information, primaryText, secondaryText);
 }
Ejemplo n.º 29
0
 internal void SetParentWindow(WindowFrame win)
 {
     parentWindow = win;
 }
Ejemplo n.º 30
0
 static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, params Command[] buttons)
 {
     return GenericAlert (parent, icon, primaryText, secondaryText, buttons.Length - 1, buttons);
 }
Ejemplo n.º 31
0
		public DefaultSelectFontDialogBackend (WindowFrame parentWindow)
		{
			parent = parentWindow;

			fontDialog = new Dialog ();
			fontDialog.Width = 500;
			fontDialog.Height = 300;

			VBox box = new VBox ();
			fontSelector = new FontSelector ();
			fontSelector.FontChanged += (sender, e) => SelectedFont = fontSelector.SelectedFont;
			box.PackStart (fontSelector, true);

			fontDialog.Content = box;

			fontDialog.Buttons.Add (new DialogButton (Command.Cancel));
			fontDialog.Buttons.Add (new DialogButton (Command.Ok));
		}
Ejemplo n.º 32
0
 public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText, Drawing.Image icon)
 {
     GenericAlert (parent, icon, primaryText, secondaryText, Command.Ok);
 }
Ejemplo n.º 33
0
		public new bool Run (WindowFrame parentWindow)
		{
			return base.Run (parentWindow) == Command.Ok;
		}
Ejemplo n.º 34
0
 /// <summary>
 /// Shows the dialog.
 /// </summary>
 public bool Run(WindowFrame parentWindow)
 {
     try {
         running = true;
         Backend.Initialize (multiselect);
         if (!string.IsNullOrEmpty (currentFolder))
             Backend.CurrentFolder = currentFolder;
         if (!string.IsNullOrEmpty (title))
             Backend.Title = title;
         return Backend.Run ((IWindowFrameBackend)BackendHost.ToolkitEngine.GetSafeBackend (parentWindow));
     } finally {
         currentFolder = Backend.CurrentFolder;
         folder = Backend.Folder;
         folders = Backend.Folders;
         currentFolder = Backend.CurrentFolder;
         running = false;
         Backend.Cleanup ();
     }
 }
Ejemplo n.º 35
0
Archivo: Dialog.cs Proyecto: garuma/xwt
        public Command Run(WindowFrame parent)
        {
            BackendHost.ToolkitEngine.ValidateObject (parent);

            BackendHost.ToolkitEngine.InvokePlatformCode (delegate {
                Backend.RunLoop ((IWindowFrameBackend) Toolkit.GetBackend (parent));
            });
            return resultCommand;
        }
Ejemplo n.º 36
0
        static Command GenericAlert(WindowFrame parent, MessageDescription message)
        {
            if (message.ApplyToAllButton != null)
                return message.ApplyToAllButton;

            IAlertDialogBackend backend = Toolkit.CurrentEngine.Backend.CreateBackend<IAlertDialogBackend> ();
            backend.Initialize (Toolkit.CurrentEngine.Context);

            using (backend) {
                var res = backend.Run (parent ?? RootWindow, message);

                if (backend.ApplyToAll)
                    message.ApplyToAllButton = res;

                return res;
            }
        }
Ejemplo n.º 37
0
 public Command Run(WindowFrame parent)
 {
     Toolkit.InvokePlatformCode (delegate {
         Backend.RunLoop ((IWindowFrameBackend) WidgetRegistry.GetBackend (parent));
     });
     return resultCommand;
 }
Ejemplo n.º 38
0
 public static bool Confirm(WindowFrame window, string primaryText, string secondaryText, Drawing.Image icon, Command button)
 {
     return GenericAlert (window, icon, primaryText, secondaryText, Command.Cancel, button) == button;
 }
Ejemplo n.º 39
0
 public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText)
 {
     GenericAlert (parent, StockIcons.Information, primaryText, secondaryText, Command.Ok);
 }
Ejemplo n.º 40
0
 public static Command AskQuestion(WindowFrame window, QuestionMessage message)
 {
     return(GenericAlert(window, message));
 }
Ejemplo n.º 41
0
 public static void ShowMessage(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText)
 {
     GenericAlert(parent, icon, primaryText, secondaryText, Command.Ok);
 }
Ejemplo n.º 42
0
 public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText)
 {
     GenericAlert (parent, StockIcons.Warning, primaryText, secondaryText, Command.Ok);
 }
Ejemplo n.º 43
0
 public static void ShowMessage(WindowFrame parent, string primaryText)
 {
     ShowMessage (parent, primaryText, null);
 }
Ejemplo n.º 44
0
		/// <summary>
		/// Shows the dialog.
		/// </summary>
		public bool Run (WindowFrame parentWindow, Action<Color> colorChangedCallback)
		{
			if(backend.Color != Colors.Transparent) {
				backend.Color = backend.Color;
			}
			return backend.Run((IWindowFrameBackend)Toolkit.CurrentEngine.GetSafeBackend(parentWindow), title, supportsAlpha, colorChangedCallback);
		}
Ejemplo n.º 45
0
 public static void ShowWarning(WindowFrame parent, string primaryText)
 {
     ShowWarning(parent, primaryText, null);
 }
Ejemplo n.º 46
0
 public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText)
 {
     ShowWarning(parent, primaryText, secondaryText, string.Empty);
 }
Ejemplo n.º 47
0
 public static void ShowMessage(WindowFrame parent, string primaryText)
 {
     ShowMessage(parent, primaryText, null);
 }
Ejemplo n.º 48
0
 public static void ShowWarning(WindowFrame parent, string primaryText)
 {
     ShowWarning (parent, primaryText, null);
 }
Ejemplo n.º 49
0
 public static void ShowError(WindowFrame parent, string primaryText)
 {
     ShowError (parent, primaryText, null);
 }
Ejemplo n.º 50
0
 internal void SetParentWindow(WindowFrame win)
 {
     parentWindow = win;
 }
Ejemplo n.º 51
0
 public static bool Confirm(WindowFrame window, string primaryText, string secondaryText, Command button)
 {
     return GenericAlert (window, Toolkit.CurrentEngine.Defaults.MessageDialog.QuestionIcon, primaryText, secondaryText, Command.Cancel, button) == button;
 }
Ejemplo n.º 52
0
        static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, int defaultButton, params Command[] buttons)
        {
            GenericMessage message = new GenericMessage () {
                Icon = icon,
                Text = primaryText,
                SecondaryText = secondaryText,
                DefaultButton = defaultButton
            };
            foreach (Command but in buttons)
                message.Buttons.Add (but);

            return GenericAlert (parent, message);
        }
Ejemplo n.º 53
0
 /// <summary>
 /// Shows the dialog.
 /// </summary>
 public bool Run(WindowFrame parentWindow)
 {
     var backend = WidgetRegistry.CreateBackend<ISelectColorDialogBackend> (GetType ());
     try {
         if (color != Colors.Transparent)
             backend.Color = color;
         return backend.Run ((IWindowFrameBackend)WidgetRegistry.GetBackend (parentWindow), title, supportsAlpha);
     } finally {
         color = backend.Color;
         backend.Dispose ();
     }
 }
Ejemplo n.º 54
0
 public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText)
 {
     GenericAlert (parent, Toolkit.CurrentEngine.Defaults.MessageDialog.WarningIcon, primaryText, secondaryText, Command.Ok);
 }
Ejemplo n.º 55
0
		/// <summary>
		/// Shows the dialog.
		/// </summary>
		public bool Run (WindowFrame parentWindow)
		{
			var backend = Toolkit.CurrentEngine.Backend.CreateBackend<ISelectFontDialogBackend> ();
			if (backend == null)
				backend = new DefaultSelectFontDialogBackend (parentWindow);
			try {
				backend.SelectedFont = SelectedFont;
				backend.Title = Title;
				backend.PreviewText = PreviewText;
				return backend.Run ((IWindowFrameBackend)Toolkit.CurrentEngine.GetSafeBackend (parentWindow));
			} catch (Exception ex) {
				Console.WriteLine (ex);
				return false;
			} finally {
				font = backend.SelectedFont;
				backend.Dispose ();
			}
		}
Ejemplo n.º 56
0
		public bool Run (WindowFrame parent)
		{
			var cmd = Dialog.Run (parent);
			return cmd == Command.Ok;
		}