void Initialize() { rva.ReadOriginalValue = () => { InitializeRawRow(); return((RVA)rawRow.RVA); }; implFlags.ReadOriginalValue = () => { InitializeRawRow(); return((MethodImplAttributes)rawRow.ImplFlags); }; flags.ReadOriginalValue = () => { InitializeRawRow(); return((MethodAttributes)rawRow.Flags); }; name.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.StringsStream.ReadNoNull(rawRow.Name)); }; signature.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.ReadSignature(rawRow.Signature)); }; implMap.ReadOriginalValue = () => { return(readerModule.ResolveImplMap(readerModule.MetaData.GetImplMapRid(Table.Method, rid))); }; methodBody.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.ReadMethodBody(this, rawRow)); }; declaringType.ReadOriginalValue = () => { return(readerModule.GetOwnerType(this)); }; }
void Initialize() { flags.ReadOriginalValue = () => { InitializeRawRow(); return((EventAttributes)rawRow.EventFlags); }; name.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.StringsStream.ReadNoNull(rawRow.Name)); }; type.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.ResolveTypeDefOrRef(rawRow.EventType)); }; declaringType.ReadOriginalValue = () => { return(readerModule.GetOwnerType(this)); }; }
void Initialize() { flags.ReadOriginalValue = () => { InitializeRawRow(); return((FieldAttributes)rawRow.Flags); }; name.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.StringsStream.ReadNoNull(rawRow.Name)); }; signature.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.ReadSignature(rawRow.Signature)); }; fieldOffset.ReadOriginalValue = () => { var row = readerModule.TablesStream.ReadFieldLayoutRow(readerModule.MetaData.GetFieldLayoutRid(rid)); return(row == null ? null : new uint?(row.OffSet)); }; fieldMarshal.ReadOriginalValue = () => { return(readerModule.ResolveFieldMarshal(readerModule.MetaData.GetFieldMarshalRid(Table.Field, rid))); }; rva.ReadOriginalValue = () => { RVA rva2; GetFieldRVA(out rva2); return(rva2); }; initialValue.ReadOriginalValue = () => { RVA rva2; if (!GetFieldRVA(out rva2)) { return(null); } return(ReadInitialValue(rva2)); }; implMap.ReadOriginalValue = () => { return(readerModule.ResolveImplMap(readerModule.MetaData.GetImplMapRid(Table.Field, rid))); }; constant.ReadOriginalValue = () => { return(readerModule.ResolveConstant(readerModule.MetaData.GetConstantRid(Table.Field, rid))); }; declaringType.ReadOriginalValue = () => { return(readerModule.GetOwnerType(this)); }; }
/// <summary> /// Constructor /// </summary> /// <param name="readerModule">The module which contains this <c>Event</c> row</param> /// <param name="rid">Row ID</param> /// <exception cref="ArgumentNullException">If <paramref name="readerModule"/> is <c>null</c></exception> /// <exception cref="ArgumentException">If <paramref name="rid"/> is invalid</exception> public EventDefMD(ModuleDefMD readerModule, uint rid) { #if DEBUG if (readerModule == null) { throw new ArgumentNullException("readerModule"); } if (readerModule.TablesStream.EventTable.IsInvalidRID(rid)) { throw new BadImageFormatException(string.Format("Event rid {0} does not exist", rid)); } #endif this.origRid = rid; this.rid = rid; this.readerModule = readerModule; uint name; uint eventType = readerModule.TablesStream.ReadEventRow(origRid, out this.attributes, out name); this.name = readerModule.StringsStream.ReadNoNull(name); this.declaringType2 = readerModule.GetOwnerType(this); this.eventType = readerModule.ResolveTypeDefOrRef(eventType, new GenericParamContext(declaringType2)); }
/// <summary> /// Constructor /// </summary> /// <param name="readerModule">The module which contains this <c>Property</c> row</param> /// <param name="rid">Row ID</param> /// <exception cref="ArgumentNullException">If <paramref name="readerModule" /> is <c>null</c></exception> /// <exception cref="ArgumentException">If <paramref name="rid" /> is invalid</exception> public PropertyDefMD(ModuleDefMD readerModule, uint rid) { #if DEBUG if (readerModule == null) { throw new ArgumentNullException("readerModule"); } if (readerModule.TablesStream.PropertyTable.IsInvalidRID(rid)) { throw new BadImageFormatException(string.Format("Property rid {0} does not exist", rid)); } #endif OrigRid = rid; this.rid = rid; this.readerModule = readerModule; uint name; var type = readerModule.TablesStream.ReadPropertyRow(OrigRid, out attributes, out name); this.name = readerModule.StringsStream.ReadNoNull(name); declaringType2 = readerModule.GetOwnerType(this); this.type = readerModule.ReadSignature(type, new GenericParamContext(declaringType2)); }
void Initialize() { flags.ReadOriginalValue = () => { InitializeRawRow(); return((PropertyAttributes)rawRow.PropFlags); }; name.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.StringsStream.ReadNoNull(rawRow.Name)); }; type.ReadOriginalValue = () => { InitializeRawRow(); return(readerModule.ReadSignature(rawRow.Type)); }; constant.ReadOriginalValue = () => { return(readerModule.ResolveConstant(readerModule.MetaData.GetConstantRid(Table.Property, rid))); }; declaringType.ReadOriginalValue = () => { return(readerModule.GetOwnerType(this)); }; }
/// <summary> /// Constructor /// </summary> /// <param name="readerModule">The module which contains this <c>Field</c> row</param> /// <param name="rid">Row ID</param> /// <exception cref="ArgumentNullException">If <paramref name="readerModule"/> is <c>null</c></exception> /// <exception cref="ArgumentException">If <paramref name="rid"/> is invalid</exception> public FieldDefMD(ModuleDefMD readerModule, uint rid) { #if DEBUG if (readerModule == null) { throw new ArgumentNullException("readerModule"); } if (readerModule.TablesStream.FieldTable.IsInvalidRID(rid)) { throw new BadImageFormatException(string.Format("Field rid {0} does not exist", rid)); } #endif this.origRid = rid; this.rid = rid; this.readerModule = readerModule; uint name; uint signature = readerModule.TablesStream.ReadFieldRow(origRid, out this.attributes, out name); this.name = readerModule.StringsStream.ReadNoNull(name); this.origAttributes = (FieldAttributes)attributes; this.declaringType2 = readerModule.GetOwnerType(this); this.signature = readerModule.ReadSignature(signature, new GenericParamContext(declaringType2)); }
/// <summary> /// Constructor /// </summary> /// <param name="readerModule">The module which contains this <c>Method</c> row</param> /// <param name="rid">Row ID</param> /// <exception cref="ArgumentNullException">If <paramref name="readerModule"/> is <c>null</c></exception> /// <exception cref="ArgumentException">If <paramref name="rid"/> is invalid</exception> public MethodDefMD(ModuleDefMD readerModule, uint rid) { #if DEBUG if (readerModule == null) { throw new ArgumentNullException("readerModule"); } if (readerModule.TablesStream.MethodTable.IsInvalidRID(rid)) { throw new BadImageFormatException(string.Format("Method rid {0} does not exist", rid)); } #endif this.origRid = rid; this.rid = rid; this.readerModule = readerModule; uint name; uint signature = readerModule.TablesStream.ReadMethodRow(origRid, out this.rva, out this.implAttributes, out this.attributes, out name); this.name = readerModule.StringsStream.ReadNoNull(name); this.origRva = rva; this.origImplAttributes = (MethodImplAttributes)implAttributes; this.declaringType2 = readerModule.GetOwnerType(this); this.signature = readerModule.ReadSignature(signature, new GenericParamContext(declaringType2, this)); this.parameterList = new ParameterList(this, declaringType2); }