public static void InspectEvent(AssemblyUsages result, EventDefinition eventDef) { if (AssemblyUsagesExtractor.debug > 1) { AssemblyUsagesExtractor.Log("Event {0}", eventDef); } using (AutoIndent.Instance) { result.RegisterTypeRef(eventDef.EventType); AssemblyUsagesExtractor.InspectAttributes(result, eventDef); if (eventDef.AddMethod != null) { AssemblyUsagesExtractor.InspectMethod(result, eventDef.AddMethod); } if (eventDef.RemoveMethod != null) { AssemblyUsagesExtractor.InspectMethod(result, eventDef.RemoveMethod); } if (eventDef.InvokeMethod != null) { AssemblyUsagesExtractor.InspectMethod(result, eventDef.InvokeMethod); } } }
public static void InspectProperty(AssemblyUsages result, PropertyDefinition propertyDef) { if (AssemblyUsagesExtractor.debug > 1) { AssemblyUsagesExtractor.Log("Property {0}", propertyDef); } using (AutoIndent.Instance) { result.RegisterTypeRef(propertyDef.PropertyType); AssemblyUsagesExtractor.InspectAttributes(result, propertyDef); AssemblyUsagesExtractor.InspectIndexer(result, propertyDef); if (propertyDef.GetMethod != null) { AssemblyUsagesExtractor.InspectMethod(result, propertyDef.GetMethod); } if (propertyDef.SetMethod != null) { AssemblyUsagesExtractor.InspectMethod(result, propertyDef.SetMethod); } } }
public static void InspectType(AssemblyUsages result, TypeDefinition typeDef) { if (AssemblyUsagesExtractor.debug > 1) { AssemblyUsagesExtractor.Log("Type {0}", typeDef); } using (AutoIndent.Instance) { AssemblyUsagesExtractor.InspectAttributes(result, typeDef); AssemblyUsagesExtractor.InspectSecurityDeclarations(result, typeDef); AssemblyUsagesExtractor.InspectGenericParameters(result, typeDef); if (typeDef.HasInterfaces == true) { foreach (InterfaceImplementation interfaceImpl in typeDef.Interfaces) { AssemblyUsagesExtractor.InspectInterface(result, interfaceImpl); } } if (typeDef.HasNestedTypes == true) { foreach (TypeDefinition nestedType in typeDef.NestedTypes) { AssemblyUsagesExtractor.InspectType(result, nestedType); } } if (typeDef.HasEvents == true) { foreach (EventDefinition eventDef in typeDef.Events) { AssemblyUsagesExtractor.InspectEvent(result, eventDef); } } if (typeDef.HasFields == true) { foreach (FieldDefinition fieldDef in typeDef.Fields) { AssemblyUsagesExtractor.InspectField(result, fieldDef); } } if (typeDef.HasProperties == true) { foreach (PropertyDefinition propertyDef in typeDef.Properties) { AssemblyUsagesExtractor.InspectProperty(result, propertyDef); } } if (typeDef.HasMethods == true) { foreach (MethodDefinition methodDef in typeDef.Methods) { AssemblyUsagesExtractor.InspectMethod(result, methodDef); } } } }