Beispiel #1
0
        public static async Task <InstallPackageResult> InstallPackageAsync(
            this Project project,
            string packageId,
            string packageVersion,
            DependencyBehavior dependencyBehaviour,
            bool allowPrerelease,
            FileConflictAction?conflictAction,
            IEnumerable <SourceRepository> sources,
            CancellationToken token)
        {
            var message = new InstallPackageParams {
                ProjectFileName    = project.FileName,
                PackageId          = packageId,
                PackageVersion     = packageVersion,
                FileConflictAction = conflictAction?.ToString(),
                DependencyBehavior = dependencyBehaviour.ToString(),
                AllowPrerelease    = allowPrerelease,
                PackageSources     = GetPackageSourceInfo(sources).ToArray()
            };

            return(await JsonRpcProvider.Rpc.InvokeWithParameterObjectAsync <InstallPackageResult> (
                       Methods.ProjectInstallPackage,
                       new[] { message },
                       token));
        }
 public InstallPackageMessageHandler(DotNetProject project, InstallPackageParams message)
 {
     this.project = project;
     this.message = message;
 }