public static AssemblyEntry Flatten(List<AssemblyEntry> entries)
        {
            var entry = new AssemblyEntry
            {
                AssemblyRef = entries[0].AssemblyRef,
                Domain = entries[0].Domain,
                DomainIndex = 1,
                Module = entries[0].Module,
                Name = entries[0].Name
            };


            //store all types
            var typedefEntries = new List<TypedefEntry>();
            entries.ForEach(x => x.Types.ForEach(typedefEntries.Add));

            //select unique type names
            var typedefNames = new List<string>();
            typedefEntries.ForEach(x => { if (!typedefNames.Contains(x.Name)) typedefNames.Add(x.Name); });

            //flatten type information
            foreach (var name in typedefNames)
            {
                var typedefName = name;
                entry.Types.Add(Flatten(entry, typedefEntries.FindAll(x => x.Name == typedefName)));
            }

            return entry;
        }
        private static TypedefEntry Flatten(AssemblyEntry assembly, List<TypedefEntry> list)
        {
            var entry = list[0].Copy(assembly);
            if (list.Count == 1) return entry;

            foreach (var typedefEntry in list.GetRange(1, list.Count - 1))
            {
                CopyCoverage(entry, typedefEntry);
            }
            return entry;
        }
Ejemplo n.º 3
0
        public TypedefEntry Copy(AssemblyEntry assembly)
        {
            var copy = new TypedefEntry
            {
                Assembly   = assembly,
                Name       = Name,
                Attributes = Attributes
            };

            copy.Methods = new List <MethodEntry>(Methods.ConvertAll(x => x.Copy(copy)));
            return(copy);
        }
Ejemplo n.º 4
0
        public TypedefEntry Copy(AssemblyEntry assembly)
        {
            var copy = new TypedefEntry
            {
                Assembly = assembly,
                Name = Name,
                Attributes = Attributes
            };

            copy.Methods = new List<MethodEntry>(Methods.ConvertAll(x => x.Copy(copy)));
            return copy;
        }
Ejemplo n.º 5
0
        public AssemblyEntry Copy()
        {
            var copy = new AssemblyEntry
            {
                AssemblyRef = AssemblyRef,
                Name = Name,
                Module = Module,
                Domain = Domain,
                DomainIndex = DomainIndex
            };
            copy.Types = new List<TypedefEntry>(Types.ConvertAll(x => x.Copy(copy)));

            return copy;
        }
Ejemplo n.º 6
0
        public AssemblyEntry Copy()
        {
            var copy = new AssemblyEntry
            {
                AssemblyRef = AssemblyRef,
                Name        = Name,
                Module      = Module,
                Domain      = Domain,
                DomainIndex = DomainIndex
            };

            copy.Types = new List <TypedefEntry>(Types.ConvertAll(x => x.Copy(copy)));

            return(copy);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Called when receiving a report about an assembly
        /// </summary>
        /// <param name="domainIndex"></param>
        /// <param name="domainName"></param>
        /// <param name="assemblyName"></param>
        /// <param name="moduleName"></param>
        public void EnterAssembly(int domainIndex, string domainName, string assemblyName, string moduleName)
        {
            _symbolReader = _symbolReaderFactory.GetSymbolReader(moduleName);
            if (_symbolReader != null)
            {
                var docs = _symbolReader.GetDocuments();
                foreach (var doc in docs)
                {
                    RegisterFile(doc.URL);
                }
            }

            Report.Assemblies.Add(currentAssembly = new AssemblyEntry
            {
                AssemblyRef = Report.Assemblies.Count + 1,
                Module = moduleName,
                Name = assemblyName,
                Domain = domainName,
                DomainIndex = domainIndex
            });
        }
Ejemplo n.º 8
0
 public void Select(AssemblyEntry assembly, string namespacePath)
 {
     SelectionHandlers.ForEach(x => x.Select(assembly, namespacePath));
 }
Ejemplo n.º 9
0
 public void Select(AssemblyEntry assembly)
 {
     SelectionHandlers.ForEach(x => x.Select(assembly));
 }
Ejemplo n.º 10
0
 public void Select(AssemblyEntry assembly, string namespacePath)
 {
     rtbNodeProps.Rtf = string.Format(NAMESPACE_INFO, namespacePath);
 }
Ejemplo n.º 11
0
 public void Select(AssemblyEntry assembly)
 {
     rtbNodeProps.Rtf = string.Format(ASSEMBLY_INFO, assembly.Name, assembly.DomainIndex, assembly.Domain, assembly.Types.Count);
 }
Ejemplo n.º 12
0
 public void Select(AssemblyEntry assembly, string namespacePath)
 {
     Deselect();
 }
Ejemplo n.º 13
0
 public void Select(AssemblyEntry assembly)
 {
     Deselect();
 }