Esempio n. 1
0
 public DiagnosticItem(AssetsFileTarget target, AssetsFileTargetLibrary library, AssetsFileLogMessage log)
     : base(log.Message)
 {
     Target  = target;
     Library = library;
     Log     = log;
 }
 public PackageBuildFileGroupItem(AssetsFileTarget target, AssetsFileTargetLibrary library, PackageBuildFileGroupType groupType)
     : base(GetGroupLabel(groupType))
 {
     Target    = target;
     Library   = library;
     GroupType = groupType;
 }
 public PackageAssemblyItem(AssetsFileTarget target, AssetsFileTargetLibrary library, string path, PackageAssemblyGroupType groupType)
     : base(System.IO.Path.GetFileName(path))
 {
     Target    = target;
     Library   = library;
     Path      = path;
     GroupType = groupType;
 }
Esempio n. 4
0
 public PackageContentFileItem(AssetsFileTarget target, AssetsFileTargetLibrary library, AssetsFileTargetLibraryContentFile contentFile, IFileIconProvider fileIconProvider)
     : base(GetProcessedContentFilePath(contentFile.Path))
 {
     Target            = target;
     Library           = library;
     ContentFile       = contentFile;
     _fileIconProvider = fileIconProvider;
 }
Esempio n. 5
0
 public PackageBuildFileItem(AssetsFileTarget target, AssetsFileTargetLibrary library, string path, PackageBuildFileGroupType groupType, FileOpener fileOpener)
     : base(System.IO.Path.GetFileName(path))
 {
     Target      = target;
     Library     = library;
     Path        = path;
     GroupType   = groupType;
     _fileOpener = fileOpener;
 }
        internal bool TryUpdateState(AssetsFileTarget target, AssetsFileTargetLibrary library)
        {
            if (ReferenceEquals(Target, target) && ReferenceEquals(Library, library))
            {
                return(false);
            }

            Target  = target;
            Library = library;
            return(true);
        }
Esempio n. 7
0
        public void ParseLibraries_LockFileTargetLibrariesMatchesDependencies_Succeeds()
        {
            // Arrange
            var lockFileTarget = new LockFileTarget();

            lockFileTarget.Libraries = new List <LockFileTargetLibrary>
            {
                new LockFileTargetLibrary()
                {
                    Name    = "packageA",
                    Type    = "package",
                    Version = NuGetVersion.Parse("1.0.0")
                },
                new LockFileTargetLibrary()
                {
                    Name    = "packageB",
                    Type    = "package",
                    Version = NuGetVersion.Parse("1.0.0")
                },
                new LockFileTargetLibrary()
                {
                    Name    = "projectA",
                    Type    = "project",
                    Version = NuGetVersion.Parse("1.0.0")
                },
                new LockFileTargetLibrary()
                {
                    Name    = "projectB",
                    Type    = "project",
                    Version = NuGetVersion.Parse("1.0.0")
                }
            };

            ImmutableDictionary <string, AssetsFileTargetLibrary> dependencies = AssetsFileDependenciesSnapshot.ParseLibraries(lockFileTarget);

            Assert.Equal(lockFileTarget.Libraries.Count, dependencies.Count);
            Assert.All <LockFileTargetLibrary>(lockFileTarget.Libraries,
                                               source =>
            {
                Assert.True(dependencies.ContainsKey(source.Name));

                AssetsFileTargetLibrary target = dependencies[source.Name];
                Assert.Equal(source.Name, target.Name);
                Assert.Equal(source.Version.ToNormalizedString(), target.Version);

                AssetsFileLibraryType sourceType;
                Assert.True(Enum.TryParse <AssetsFileLibraryType>(source.Type, ignoreCase: true, out sourceType));
                Assert.Equal(sourceType, target.Type);
            });
        }
 protected override bool TryUpdateItem(ProjectReferenceItem item, AssetsFileTarget targetData, AssetsFileTargetLibrary library)
 {
     return(item.TryUpdateState(targetData, library));
 }
 protected override ProjectReferenceItem CreateItem(AssetsFileTarget targetData, AssetsFileTargetLibrary library)
 {
     return(new ProjectReferenceItem(targetData, library));
 }
 public BrowseObject(AssetsFileTargetLibrary library) => _library = library;
 public ProjectReferenceItem(AssetsFileTarget target, AssetsFileTargetLibrary library)
     : base(library.Name)
 {
     Target  = target;
     Library = library;
 }
 public PackageContentFileGroupItem(AssetsFileTarget target, AssetsFileTargetLibrary library)
     : base(VsResources.PackageContentFilesGroupName)
 {
     Target  = target;
     Library = library;
 }
Esempio n. 13
0
 protected abstract bool TryUpdateItem(TItem item, AssetsFileTarget targetData, AssetsFileTargetLibrary library);
Esempio n. 14
0
 protected abstract TItem CreateItem(AssetsFileTarget targetData, AssetsFileTargetLibrary library);
Esempio n. 15
0
 private static string GetCaption(AssetsFileTargetLibrary library) => $"{library.Name} ({library.Version})";
Esempio n. 16
0
 public PackageReferenceItem(AssetsFileTarget target, AssetsFileTargetLibrary library)
     : base(GetCaption(library))
 {
     Library = library;
     Target  = target;
 }