示例#1
0
        public static bool ShowModal(IWin32Window Owner, string ServerAndPort, string UserName, string WorkspaceName, TextWriter Log, out string NewWorkspaceName)
        {
            EnumerateWorkspacesTask EnumerateWorkspaces = new EnumerateWorkspacesTask();

            string          ErrorMessage;
            ModalTaskResult Result = PerforceModalTask.Execute(Owner, null, ServerAndPort, UserName, EnumerateWorkspaces, "Finding workspaces", "Finding workspaces, please wait...", Log, out ErrorMessage);

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

                NewWorkspaceName = null;
                return(false);
            }

            SelectWorkspaceWindow SelectWorkspace = new SelectWorkspaceWindow(EnumerateWorkspaces.Info, EnumerateWorkspaces.Clients, WorkspaceName);

            if (SelectWorkspace.ShowDialog(Owner) == DialogResult.OK)
            {
                NewWorkspaceName = SelectWorkspace.WorkspaceName;
                return(true);
            }
            else
            {
                NewWorkspaceName = null;
                return(false);
            }
        }
示例#2
0
        private void WorkspaceNameBrowseBtn_Click(object sender, EventArgs e)
        {
            string WorkspaceName = WorkspaceNameTextBox.Text;

            if (SelectWorkspaceWindow.ShowModal(this, Perforce, WorkspaceName, Log, out WorkspaceName))
            {
                WorkspaceNameTextBox.Text = WorkspaceName;
                UpdateOkButton();
            }
        }
        private void WorkspaceBrowseBtn_Click(object sender, EventArgs e)
        {
            WorkspaceRadioBtn.Checked = true;

            string WorkspaceName = WorkspaceNameTextBox.Text;

            if (SelectWorkspaceWindow.ShowModal(this, Perforce, WorkspaceName, Log, out WorkspaceName))
            {
                WorkspaceNameTextBox.Text = WorkspaceName;
            }
        }