Beispiel #1
0
        public IEnumerator InstallReleasesAsync(List <ReleaseInfo> releaseInfos)
        {
            // Need to make sure we have the most recent package list so we can determine whether this is
            // an upgrade / downgrade / etc.
            yield return(_packageHandler.RefreshPackagesAsync());

            Assert.That(releaseInfos.Select(x => x.Id).GetDuplicates().IsEmpty(), "Found duplicate releases selected - are you installing multiple versions of the same release?");

            var packageRoot = _model.TryGetCurrentPackageFolderPath();

            Assert.IsNotNull(packageRoot, "Please select a package folder before attempting to install a release");

            foreach (var releaseInfo in releaseInfos)
            {
                var userChoice = CheckShouldInstall(releaseInfo);

                yield return(userChoice);

                switch (userChoice.Current)
                {
                case InstallReleaseUserChoices.Cancel:
                {
                    yield break;
                }

                case InstallReleaseUserChoices.Install:
                {
                    yield return(_prjCommandHandler.ProcessPrjCommand(
                                     "Installing release '{0}'".Fmt(releaseInfo.Name), PrjHelper.InstallReleaseAsync(packageRoot, releaseInfo)));

                    break;
                }

                case InstallReleaseUserChoices.Skip:
                {
                    // Do nothing
                    break;
                }

                default:
                {
                    Assert.Throw();
                    break;
                }
                }
            }

            yield return(_packageHandler.RefreshPackagesAsync());
        }
        IEnumerator InitializeAsync()
        {
            Assert.That(!_isInitialized);
            _projectHandler.RefreshProject();

            yield return(_packageHandler.RefreshPackagesAsync());

            yield return(_releasesHandler.RefreshReleasesAsync());

            _isInitialized = true;
        }
Beispiel #3
0
        IEnumerator InitializeAsync(bool isFirstLoad)
        {
            Assert.That(!_isInitialized);

            if (isFirstLoad)
            {
                _projectHandler.RefreshProject();

                yield return(_packageHandler.RefreshPackagesAsync());

                yield return(_releasesHandler.RefreshReleasesAsync());
            }

            _isInitialized = true;
        }
 public void OnClickedRefreshPackages()
 {
     _asyncProcessor.Process(_packageHandler.RefreshPackagesAsync(), "Refreshing Packages");
 }