public void EditRepositoryHandler(object sender, EventArgs e) { RepositoryDialog dialog = new RepositoryDialog(currentWorkspace); dialog.Run(); dialog.Destroy(); }
public void AddRepositoryHandler(object sender, EventArgs e) { RepositoryDialog dialog = new RepositoryDialog(null); if (dialog.Run() == (int)ResponseType.Ok) { try { ICredentials creds = new TFCredential(dialog.Username, dialog.Password); TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(dialog.Server, creds); VersionControlServer vcs = tfs.GetService(typeof(VersionControlServer)) as VersionControlServer; vcs.CreateWorkspace(dialog.WorkspaceName, dialog.Username, "Created by OpenTF Gui", null, Environment.MachineName); } catch (WebException ex) { Console.WriteLine(ex.ToString()); } } dialog.Destroy(); }