public static bool ShowModal(IWin32Window Owner, PerforceConnection Perforce, TextWriter Log, out string SelectedUserName)
        {
            EnumerateUsersTask Task = new EnumerateUsersTask();

            string          ErrorMessage;
            ModalTaskResult Result = PerforceModalTask.Execute(Owner, Perforce, Task, "Finding users", "Finding users, please wait...", Log, out ErrorMessage);

            if (Result != ModalTaskResult.Succeeded)
            {
                if (!String.IsNullOrEmpty(ErrorMessage))
                {
                    MessageBox.Show(Owner, ErrorMessage);
                }

                SelectedUserName = null;
                return(false);
            }

            SelectUserWindow SelectUser = new SelectUserWindow(Task.Users, 0);

            if (SelectUser.ShowDialog(Owner) == DialogResult.OK)
            {
                SelectedUserName = Task.Users[SelectUser.SelectedUserIndex].Name;
                return(true);
            }
            else
            {
                SelectedUserName = null;
                return(false);
            }
        }
Esempio n. 2
0
        private void UserBrowseBtn_Click(object sender, EventArgs e)
        {
            string SelectedUserName;

            if (SelectUserWindow.ShowModal(this, Perforce, new BufferedTextWriter(), out SelectedUserName))
            {
                UserNameTextBox.Text = SelectedUserName;
            }
        }
Esempio n. 3
0
        private void BrowseUserBtn_Click(object sender, EventArgs e)
        {
            string NewUserName;

            if (SelectUserWindow.ShowModal(this, ServerAndPortTextBox.Text, UserNameTextBox.Text, Log, out NewUserName))
            {
                UserNameTextBox.Text = NewUserName;
            }
        }