async Task <CodeContainer> RunAcquisitionAsync(IProgress <ServiceProgressData> downloadProgress, CancellationToken cancellationToken, string url = null)
        {
            var result = await ShowCloneDialogAsync(downloadProgress, cancellationToken, url);

            if (result == null)
            {
                return(null);
            }

            var repositoryName         = result.Url.RepositoryName;
            var repositoryRootFullPath = result.Path;
            var sccProvider            = new Guid(Guids.GitSccProviderId);
            var codeContainerProvider  = new Guid(Guids.CodeContainerProviderId);
            var displayUrl             = result.Url.ToRepositoryUrl();
            var browseOnlineUrl        = new Uri(displayUrl.ToString().TrimSuffix(".git"));
            var lastAccessed           = DateTimeOffset.UtcNow;

            var codeContainer = new CodeContainer(
                localProperties: new CodeContainerLocalProperties(repositoryRootFullPath, CodeContainerType.Folder,
                                                                  new CodeContainerSourceControlProperties(repositoryName, repositoryRootFullPath, sccProvider)),
                remote: new RemoteCodeContainer(repositoryName, codeContainerProvider, displayUrl, browseOnlineUrl, lastAccessed),
                isFavorite: false,
                lastAccessed: lastAccessed);

            // Report all steps complete before returning a CodeContainer
            downloadProgress.Report(new ServiceProgressData(string.Empty, string.Empty, 1, 1));

            return(codeContainer);
        }
Example #2
0
 public Task <CodeContainer> AcquireCodeContainerAsync(CodeContainer onlineCodeContainer, IProgress <ServiceProgressData> downloadProgress, CancellationToken cancellationToken)
 {
     // Implementing this interface member is required,
     // but it will never be used.
     return(null);
 }