Esempio 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);
            }
        }
Esempio n. 2
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);
            }
        }