private AddProjectToSourceControl ( IVsSccProject2 project ) : System.Threading.Tasks.Task | ||
project | IVsSccProject2 | |
return | System.Threading.Tasks.Task |
internal async Task AddProjectToSourceControl(IVsSccProject2 project)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
string projectName = await GetProjectFileName(project as IVsHierarchy);
if (string.IsNullOrEmpty(projectName)) return;
string projectDirecotry = Path.GetDirectoryName(projectName);
var repo = RepositoryManager.Instance.GetTrackerForPath(projectDirecotry);
repo.AddFile(projectName);
var files = await SolutionExtensions.GetProjectFiles(project);
foreach (var file in files)
{
repo.AddFile(file);
}
}
#endregion
private async void OnAddProjectToSCC(object sender, EventArgs e) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); var project = SolutionExtensions.GetSelectedProjectHierarchy() as IVsSccProject2; if (project != null) { await sccService.AddProjectToSourceControl(project); } }