Ejemplo n.º 1
0
        public RepositoryDialog(Workspace workspace) : base((workspace == null)? "Add Repository" : "Edit Repository")
        {
            Table table = new Table(3, 2, false);

            table.RowSpacing    = ((uint)(6));
            table.ColumnSpacing = ((uint)(6));
            table.BorderWidth   = ((uint)(12));

            name   = AddLabeledEntry(table, "_Name:", 1, 2);
            server = AddLabeledEntry(table, "_Server:", 2, 3);
            table.Attach(new Gtk.HSeparator(), 0, 2, 3, 4);

            username = AddLabeledEntry(table, "_Username:"******"_Password:"******"OK", ResponseType.Ok) as Button;
            AddCloseButton("Cancel");
            DefaultResponse = ResponseType.Ok;

            if (workspace != null)
            {
                name.Text = workspace.Name;
                Uri uri = workspace.VersionControlServer.TeamFoundationServer.Uri;
                server.Text = uri.Host.ToString();

                string creds = Keyring.GetCredentials(uri.ToString());
                int    comma = creds.IndexOf(",");

                if (comma != -1)
                {
                    username.Text = creds.Substring(0, comma);
                    password.Text = creds.Substring(comma + 1);
                }
                else
                {
                    username.Text = creds;
                }
            }
            else
            {
                name.Text     = "CodePlex";
                server.Text   = "https://tfs01.codeplex.com";
                username.Text = "snd\\";
            }

            ShowAll();
        }
Ejemplo n.º 2
0
    private string GetLogin()
    {
        if (!String.IsNullOrEmpty(Options.Login))
        {
            return(Options.Login);
        }

        // check the keyring
        string login = Keyring.GetCredentials(ServerUrl);

        if (!String.IsNullOrEmpty(login))
        {
            return(login);
        }

        // finally prompt
        return(PromptForLogin(ServerUrl));
    }
Ejemplo n.º 3
0
    private string GetLogin(string url)
    {
        if (!String.IsNullOrEmpty(Options.Login))
        {
            return(Options.Login);
        }

        // check the keyring
        string login = Keyring.GetCredentials(url);

        if (!String.IsNullOrEmpty(login))
        {
            return(login);
        }

        // finally prompt if permitted
        if (Options.NoPrompt)
        {
            return(String.Empty);
        }
        return(PromptForLogin(url));
    }