Exemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            CancelEventArgs cea = new CancelEventArgs();

            ValidateAdd(this, cea);

            if (cea.Cancel)
            {
                DialogResult = DialogResult.None;
            }
            else if (Context != null)
            {
                RepositoryTreeNode rtn = repositoryTree.SelectedNode;

                if (rtn != null && rtn.RepositoryRoot != null)
                {
                    IAnkhConfigurationService config = Context.GetService <IAnkhConfigurationService>();

                    RegistryLifoList lifo = config.GetRecentReposUrls();

                    string url = rtn.RepositoryRoot.ToString();
                    if (!lifo.Contains(url))
                    {
                        lifo.Add(url);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void okButton_Click(object sender, EventArgs e)
        {
            RegistryLifoList recentUrls = GetService <IAnkhConfigurationService>().GetRecentReposUrls();

            Uri fullUri;

            if (!string.IsNullOrEmpty(urlTextBox.Text) && Uri.TryCreate(urlTextBox.Text, UriKind.Absolute, out fullUri))
            {
                string toAdd = fullUri.AbsoluteUri;
                if (!recentUrls.Contains(toAdd))
                {
                    recentUrls.Add(toAdd);
                }
            }
        }
        private void okButton_Click(object sender, EventArgs e)
        {
            RepositoryTreeNode rtn = reposBrowser.SelectedNode;

            if (rtn != null && rtn.Origin != null)
            {
                IAnkhConfigurationService ics  = GetService <IAnkhConfigurationService>();
                RegistryLifoList          lifo = null;

                if (ics != null)
                {
                    lifo = ics.GetRecentReposUrls();
                }

                string url = rtn.Origin.RepositoryRoot.AbsoluteUri;

                if (lifo != null && !lifo.Contains(url))
                {
                    lifo.Add(url);
                }
            }
        }