Esempio n. 1
0
        public static async Task InstallPackages(Solution solution, IList <PackageReferencesForCreatedProject> packages)
        {
            var actions = await Runtime.RunInMainThread(() => {
                var installer = new ProjectTemplateNuGetPackageInstaller();
                return(installer.CreateInstallPackageActions(solution, packages));
            });

            if (!actions.Any())
            {
                return;
            }

            await Task.Run(() => {
                foreach (var action in actions)
                {
                    var installAction = action as InstallNuGetPackageAction;
                    if (installAction != null)
                    {
                        installAction.LicensesMustBeAccepted = false;
                    }

                    action.Execute();
                }
            });
        }
		public static async Task InstallPackages (Solution solution, IList<PackageReferencesForCreatedProject> packages)
		{
			var actions = await Runtime.RunInMainThread (() => {
				var installer = new ProjectTemplateNuGetPackageInstaller ();
				return installer.CreateInstallPackageActions (solution, packages);
			});

			if (!actions.Any ())
				return;

			await Task.Run (() => {
				foreach (var action in actions) {
					var installAction = action as InstallNuGetPackageAction;
					if (installAction != null)
						installAction.LicensesMustBeAccepted = false;

					action.Execute ();
				}
			});
		}