Esempio n. 1
0
        public FrameworkEntry StartProcessingAssembly(AssemblySet set, AssemblyDefinition assembly, IEnumerable <DocumentationImporter> importers, string Id, string Version)
        {
            if (string.IsNullOrWhiteSpace(this.path))
            {
                set.Framework = FrameworkEntry.Empty;
                return(FrameworkEntry.Empty);
            }

            string assemblyPath        = assembly.MainModule.FileName;
            var    frameworksDirectory = this.path.EndsWith("frameworks.xml", StringComparison.OrdinalIgnoreCase)
                                                ? Path.GetDirectoryName(this.path) : this.path;
            string relativePath = assemblyPath.Replace(frameworksDirectory, string.Empty);
            string shortPath    = Path.GetDirectoryName(relativePath);

            if (shortPath.StartsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.InvariantCultureIgnoreCase))
            {
                shortPath = shortPath.Substring(1, shortPath.Length - 1);
            }


            var entry = frameworks.FirstOrDefault(f => f.Name.Equals(shortPath));

            if (entry == null)
            {
                entry = new FrameworkEntry(frameworks, FrameworksCount)
                {
                    Name = shortPath, Importers = importers, Id = Id, Version = Version
                };
                frameworks.Add(entry);
            }

            set.Framework = entry;
            return(entry);
        }
Esempio n. 2
0
        public FrameworkEntry StartProcessingAssembly(AssemblySet set, AssemblyDefinition assembly, IEnumerable <DocumentationImporter> importers, string Id, string Version)
        {
            if (string.IsNullOrWhiteSpace(this.path))
            {
                set.Framework = FrameworkEntry.Empty;
                return(FrameworkEntry.Empty);
            }

            string assemblyPath = assembly.MainModule.FileName;
            string shortPath    = GetFrameworkNameFromPath(this.path, assemblyPath);

            var entry = frameworks.FirstOrDefault(f => f.Name.Equals(shortPath));

            if (entry == null)
            {
                entry = new FrameworkEntry(frameworks, FrameworksCount, cachedFrameworks)
                {
                    Name = shortPath, Importers = importers, Id = Id, Version = Version
                };
                frameworks.Add(entry);
            }

            set.Framework = entry;
            entry.AddProcessedAssembly(assembly);

            return(entry);
        }