Mono.Addins.Gui.NewSiteDialog.Run C# (CSharp) Method

Run() public method

public Run ( ) : bool
return bool
        public new bool Run()
        {
            ShowAll ();
            return ((ResponseType) base.Run ()) == ResponseType.Ok;
        }

Usage Example

Example #1
0
        protected void OnAdd(object sender, EventArgs e)
        {
            NewSiteDialog dlg = new NewSiteDialog();

            try {
                if (dlg.Run())
                {
                    string url = dlg.Url;
                    if (!url.StartsWith("http://") && !url.StartsWith("https://") && !url.StartsWith("file://"))
                    {
                        url = "http://" + url;
                    }

                    try {
                        new Uri(url);
                    } catch {
                        Services.ShowError(null, "Invalid url: " + url, null, true);
                    }

                    if (!service.Repositories.ContainsRepository(url))
                    {
                        IProgressStatus m  = new ConsoleProgressStatus(false);
                        AddinRepository rr = service.Repositories.RegisterRepository(m, url);
                        if (rr == null)
                        {
                            Services.ShowError(null, "The repository could not be registered", null, true);
                            return;
                        }
                        treeStore.AppendValues(rr.Url, rr.Title);
                    }
                }
            } finally {
                dlg.Destroy();
            }
        }
All Usage Examples Of Mono.Addins.Gui.NewSiteDialog::Run