private void BrowseWorkspaceBtn_Click(object sender, EventArgs e) { this.TopMost = false; P4ScmProvider _scm = new P4ScmProvider(null); _scm.Connection.Port = ServerPort; _scm.Connection.User = UserName; _scm.Connection.Connect(true, null, true); if (_scm.Connected && _scm.Connection.isLoggedIn()) { WorkspacesBrowserDlg dlg = new WorkspacesBrowserDlg(_scm, "connection", null, null); dlg.TopMost = true; if (DialogResult.Cancel != dlg.ShowDialog()) { if ((dlg.SelectedWorkspace != null) && (dlg.SelectedWorkspace.Name != null)) { WorkspaceTB.Text = dlg.SelectedWorkspace.Name.ToString(); } } _scm.Dispose(); } this.TopMost = true; }
//string SandboxResults = null; //public void SandboxDataReceived(Object sender, DataReceivedEventArgs e) //{ // SandboxResults += e.Data; //} private void ConfigureSandboxBtn_Click(object sender, EventArgs e) { if (SandboxConfigPath == null) { return; } P4ScmProvider _scm = new P4ScmProvider(null); _scm.Connection.Port = ServerPort; _scm.Connection.User = UserName; _scm.Connection.Workspace = Workspace; string charset = null; _scm.Connection.Connect(true, null); if (_scm.Connected) { charset = _scm.Connection.Repository.Connection.CharacterSetName; } _scm.Dispose(); this.TopMost = false; Process ConfigSandboxProc = new Process(); string args = string.Format("-p {0} -u {1} -c {2}", ServerTB.Text, UserTB.Text, WorkspaceTB.Text); if (charset != null) { args += string.Format(" -C {0}", charset); } ConfigSandboxProc.StartInfo = new ProcessStartInfo(SandboxConfigPath); ConfigSandboxProc.StartInfo.Arguments = args; ConfigSandboxProc.StartInfo.RedirectStandardOutput = true; ConfigSandboxProc.StartInfo.UseShellExecute = false; ConfigSandboxProc.StartInfo.CreateNoWindow = false; ParameterizedThreadStart threadProc = new ParameterizedThreadStart(ConfigureSandboxRunThreadProc); Thread t = new Thread(threadProc); t.Start(ConfigSandboxProc); this.Enabled = false; //ConfigureSandboxRunThreadProc((object)ConfigSandboxProc); }
private void NewUserBtn_Click(object sender, EventArgs e) { this.TopMost = false; P4ScmProvider _scm = new P4ScmProvider(null); _scm.Connection.Port = ServerPort; _scm.Connection.Connect(true, null, true); if (_scm.Connected && _scm.Connection.ServerConnected()) { NewUserDlg dlg = new NewUserDlg(_scm); P4.User newUser = dlg.Show(_scm); dlg.TopMost = true; if (null != newUser) { //_scm.NewUser(newUser); UserTB.Text = newUser.Id; } _scm.Dispose(); } this.TopMost = true; }
private void BrowseUserBtn_Click(object sender, EventArgs e) { this.TopMost = false; P4ScmProvider _scm = new P4ScmProvider(null); _scm.Connection.Port = ServerPort; _scm.Connection.Connect(true, null, true); if (_scm.Connected && _scm.Connection.ServerConnected()) { UsersBrowserDlg dlg = new UsersBrowserDlg(_scm, null); dlg.TopMost = true;; if ((DialogResult.Cancel != dlg.ShowDialog()) && (dlg.SelectedUser.Id != null)) { UserTB.Text = dlg.SelectedUser.Id; } } _scm.Dispose(); this.TopMost = true;; }