Ejemplo n.º 1
0
 void MatchExportedType(ExportedType exportedType, ModuleDefinition module, Regex regex, XPathNavigator nav)
 {
     if (regex.Match(exportedType.FullName).Success)
     {
         MarkingHelpers.MarkExportedType(exportedType, module, new DependencyInfo(DependencyKind.XmlDescriptor, _xmlDocumentLocation));
         TypeDefinition type = exportedType.Resolve();
         if (type != null)
         {
             ProcessType(type, nav);
         }
     }
 }
 void MatchExportedType(ExportedType exportedType, ModuleDefinition module, Regex regex, XPathNavigator nav)
 {
     if (regex.Match(exportedType.FullName).Success)
     {
         MarkingHelpers.MarkExportedType(exportedType, module);
         TypeDefinition type = exportedType.Resolve();
         if (type != null)
         {
             ProcessType(type, nav);
         }
     }
 }
        void ProcessTypes(AssemblyDefinition assembly, XPathNodeIterator iterator)
        {
            while (iterator.MoveNext())
            {
                XPathNavigator nav = iterator.Current;

                string fullname = GetFullName(nav);

                if (IsTypePattern(fullname))
                {
                    ProcessTypePattern(fullname, assembly, nav);
                    continue;
                }

                TypeDefinition type = assembly.MainModule.GetType(fullname);

                if (type == null)
                {
                    if (assembly.MainModule.HasExportedTypes)
                    {
                        foreach (var exported in assembly.MainModule.ExportedTypes)
                        {
                            if (fullname == exported.FullName)
                            {
                                Tracer.Push(exported);
                                MarkingHelpers.MarkExportedType(exported, assembly.MainModule);
                                var resolvedExternal = exported.Resolve();
                                Tracer.Pop();
                                if (resolvedExternal != null)
                                {
                                    type = resolvedExternal;
                                    break;
                                }
                            }
                        }
                    }
                }

                if (type == null)
                {
                    continue;
                }

                ProcessType(type, nav);
            }
        }
Ejemplo n.º 4
0
        void ProcessTypes(AssemblyDefinition assembly, XPathNodeIterator iterator)
        {
            while (iterator.MoveNext())
            {
                XPathNavigator nav = iterator.Current;

                string fullname = GetFullName(nav);

                if (IsTypePattern(fullname))
                {
                    ProcessTypePattern(fullname, assembly, nav);
                    continue;
                }

                TypeDefinition type = assembly.MainModule.GetType(fullname);

                if (type == null)
                {
                    if (assembly.MainModule.HasExportedTypes)
                    {
                        foreach (var exported in assembly.MainModule.ExportedTypes)
                        {
                            if (fullname == exported.FullName)
                            {
                                MarkingHelpers.MarkExportedType(exported, assembly.MainModule, new DependencyInfo(DependencyKind.XmlDescriptor, _xmlDocumentLocation));
                                var resolvedExternal = exported.Resolve();
                                if (resolvedExternal != null)
                                {
                                    type = resolvedExternal;
                                    break;
                                }
                            }
                        }
                    }
                }

                if (type == null)
                {
                    continue;
                }

                ProcessType(type, nav);
            }
        }
Ejemplo n.º 5
0
 protected override TypeDefinition ProcessExportedType(ExportedType exported, AssemblyDefinition assembly)
 {
     MarkingHelpers.MarkExportedType(exported, assembly.MainModule, new DependencyInfo(DependencyKind.XmlDescriptor, _xmlDocumentLocation));
     return(base.ProcessExportedType(exported, assembly));
 }