public CecilMethodBase(CecilTypeSystem typeSystem, MethodDefinition method, TypeReference declaringType) { TypeSystem = typeSystem; MethodReference MakeRef(bool transform) { TypeReference Transform(TypeReference r) => transform?r.TransformGeneric(declaringType) : r; var reference = new MethodReference(method.Name, Transform(method.ReturnType), declaringType) { HasThis = method.HasThis, ExplicitThis = method.ExplicitThis, }; foreach (ParameterDefinition parameter in method.Parameters) { reference.Parameters.Add( new ParameterDefinition(Transform(parameter.ParameterType))); } foreach (var genericParam in method.GenericParameters) { reference.GenericParameters.Add(new GenericParameter(genericParam.Name, reference)); } return(reference); } Reference = MakeRef(true); IlReference = MakeRef(false); Definition = method; _declaringTypeReference = declaringType; }
public CecilType(CecilTypeSystem typeSystem, CecilAssembly assembly, TypeDefinition definition, TypeReference reference) { _assembly = assembly; TypeSystem = typeSystem; Reference = reference; Definition = definition; }
public CecilType(CecilTypeSystem typeSystem, CecilAssembly assembly, TypeDefinition definition, TypeReference reference) { _assembly = assembly; TypeSystem = typeSystem; Reference = reference; Definition = definition; if (reference.IsArray) { Definition = ((CecilType)typeSystem.GetType("System.Array")).Definition; } }
public CecilField(CecilTypeSystem typeSystem, FieldDefinition def, TypeReference declaringType) { TypeSystem = typeSystem; _def = def; Field = new FieldReference(def.Name, def.FieldType.TransformGeneric(declaringType), declaringType); }
public CecilTypeBuilder(CecilTypeSystem typeSystem, CecilAssembly assembly, TypeDefinition definition) : base(typeSystem, assembly, definition) { }
public CecilProperty(CecilTypeSystem typeSystem, PropertyDefinition property, TypeReference declaringType) { _declaringType = declaringType; TypeSystem = typeSystem; Property = property; }
public CecilTypeCache(CecilTypeSystem typeSystem) { TypeSystem = typeSystem; }
public CecilEvent(CecilTypeSystem typeSystem, EventDefinition ev, TypeReference declaringType) { _declaringType = declaringType; TypeSystem = typeSystem; Event = ev; }
public CecilMethod(CecilTypeSystem typeSystem, MethodDefinition methodDef, TypeReference declaringType) : base(typeSystem, methodDef, declaringType) { }
public CecilAssembly(CecilTypeSystem typeSystem, AssemblyDefinition assembly) { TypeSystem = typeSystem; Assembly = assembly; }
public CecilCustomAttribute(CecilTypeSystem typeSystem, CustomAttribute data) { TypeSystem = typeSystem; Data = data; }
public CecilType(CecilTypeSystem typeSystem, CecilAssembly assembly, TypeDefinition definition) : this(typeSystem, assembly, definition, definition) { }
public CustomMetadataResolver(CecilTypeSystem typeSystem) : base(typeSystem) { _typeSystem = typeSystem; }