Ejemplo n.º 1
0
        void AddConfiguration(string copyFrom)
        {
            var dlg = new NewConfigurationDialog(configData.Configurations);

            try
            {
                bool done = false;
                do
                {
                    if (MessageService.RunCustomDialog(dlg, Toplevel as Gtk.Window) == (int)Gtk.ResponseType.Ok)
                    {
                        var cc = configData.AddConfiguration(dlg.ConfigName, copyFrom, dlg.CreateChildren);
                        store.AppendValues(cc, cc.Id);
                        done = true;
                    }
                    else
                    {
                        done = true;
                    }
                }while (!done);
            }
            finally
            {
                dlg.Destroy();
            }
        }
        void AddConfiguration(string copyFrom)
        {
            Xwt.Toolkit.NativeEngine.Invoke(delegate {
                bool done = false;

                do
                {
                    using (var dlg = new NewConfigurationDialog(configData.Entry, configData.Configurations)) {
                        if (dlg.Run(Xwt.MessageDialog.RootWindow) == Xwt.Command.Ok)
                        {
                            var cc = configData.AddConfiguration(dlg.ConfigName, copyFrom, dlg.CreateChildren);
                            store.AppendValues(cc, cc.Id);
                            done = true;
                        }
                        else
                        {
                            done = true;
                        }
                    }
                } while (!done);
            });
        }