Пример #1
0
    public string PromptForLogin(string serverUrl)
    {
        Application.Init();
        AuthenticationDialog dialog = new AuthenticationDialog(serverUrl);

        dialog.ShowAll();
        int rc = dialog.Run();

        string login = dialog.Login;
        dialog.Destroy();

        if (rc != Convert.ToInt32(ResponseType.Ok)) return String.Empty;
        return login;
    }
Пример #2
0
        public string PromptForLogin(string uri)
        {
            // first look in password cache
            string login = TeamFoundationSettings.Current.Get(uri);
            if (!String.IsNullOrEmpty(login)) return login;

            // now prompt
            AuthenticationDialog dialog = new AuthenticationDialog(uri);
            dialog.ShowAll();
            int rc = dialog.Run();

            login = dialog.Login;
            dialog.Destroy();

            if (rc != Convert.ToInt32(ResponseType.Ok)) return String.Empty;
            return login;
        }