public VsTargetFrameworkInfo(
            string targetFrameworkMoniker,
            IEnumerable <IVsReferenceItem> packageReferences,
            IEnumerable <IVsReferenceItem> projectReferences,
            IEnumerable <IVsProjectProperty> projectProperties)
        {
            if (string.IsNullOrEmpty(targetFrameworkMoniker))
            {
                throw new ArgumentException(ProjectManagement.Strings.Argument_Cannot_Be_Null_Or_Empty, nameof(targetFrameworkMoniker));
            }

            if (packageReferences == null)
            {
                throw new ArgumentNullException(nameof(packageReferences));
            }

            if (projectReferences == null)
            {
                throw new ArgumentNullException(nameof(projectReferences));
            }

            if (projectProperties == null)
            {
                throw new ArgumentNullException(nameof(projectProperties));
            }

            TargetFrameworkMoniker = targetFrameworkMoniker;
            PackageReferences      = new VsReferenceItems(packageReferences);
            ProjectReferences      = new VsReferenceItems(projectReferences);
            Properties             = new VsProjectProperties(projectProperties);
        }
Esempio n. 2
0
        public VsTargetFrameworkInfo(
            string targetFrameworkMoniker,
            IEnumerable <IVsReferenceItem> packageReferences,
            IEnumerable <IVsReferenceItem> projectReferences,
            IEnumerable <IVsProjectProperty> projectProperties)
        {
            if (string.IsNullOrEmpty(targetFrameworkMoniker))
            {
                throw new ArgumentException("Argument cannot be null or empty", nameof(targetFrameworkMoniker));
            }

            if (packageReferences == null)
            {
                throw new ArgumentNullException(nameof(packageReferences));
            }

            if (projectReferences == null)
            {
                throw new ArgumentNullException(nameof(projectReferences));
            }

            if (projectProperties == null)
            {
                throw new ArgumentNullException(nameof(projectProperties));
            }

            TargetFrameworkMoniker = targetFrameworkMoniker;
            PackageReferences      = new VsReferenceItems(packageReferences);
            ProjectReferences      = new VsReferenceItems(projectReferences);
            Properties             = new VsProjectProperties(projectProperties);
        }
        public VsTargetFrameworkInfo(
            string targetFrameworkMoniker,
            IEnumerable <IVsReferenceItem> packageReferences,
            IEnumerable <IVsReferenceItem> projectReferences,
            IEnumerable <IVsProjectProperty> projectProperties,
            bool addTargetFrameworkProperties = true)
        {
            if (string.IsNullOrEmpty(targetFrameworkMoniker))
            {
                throw new ArgumentException("Argument cannot be null or empty", nameof(targetFrameworkMoniker));
            }

            if (packageReferences == null)
            {
                throw new ArgumentNullException(nameof(packageReferences));
            }

            if (projectReferences == null)
            {
                throw new ArgumentNullException(nameof(projectReferences));
            }

            if (projectProperties == null)
            {
                throw new ArgumentNullException(nameof(projectProperties));
            }

            TargetFrameworkMoniker = targetFrameworkMoniker;
            PackageReferences      = new VsReferenceItems(packageReferences);
            ProjectReferences      = new VsReferenceItems(projectReferences);
            Properties             =
                addTargetFrameworkProperties
                ? new VsProjectProperties(ProjectRestoreInfoBuilder.GetTargetFrameworkProperties(targetFrameworkMoniker).Concat(projectProperties))
                : new VsProjectProperties(projectProperties);
        }