/*-------------------- Constructors ---------------------------------*/ internal CustomAttribute(MetaDataElement paren, Method constrType, Constant[] val) { Contract.Requires(constrType != null); parent = paren; type = constrType; argVals = val; changed = true; tabIx = MDTable.CustomAttribute; }
/*----------------------------- internal functions ------------------------------*/ internal void AddMethod(Method meth) { Contract.Requires(meth != null); methods.Add(meth); meth.SetParent(this); }
internal void AddToMethodList(Method m) { Contract.Requires(m != null); m.SetParent(this); methods.Add(m); }
/// <summary> /// Remove the specified method from this class /// </summary> /// <param name="meth">method descriptor</param> public void RemoveMethod(Method meth) { Contract.Requires(meth != null); methods.Remove(meth); }
/// <summary> /// Use a method as the implementation for another method (.override) /// </summary> /// <param name="decl">the method to be overridden</param> /// <param name="body">the implementation to be used</param> public void AddMethodOverride(Method decl, Method body) { methodImpls.Add(new MethodImpl(this, decl, body)); }
internal override void Resolve(PEReader buff) { methParent = (Method)buff.GetCodedElement(CIx.MethodDefOrRef, parentIx); buff.currentMethodScope = methParent; // set scopes - Fix by CK buff.currentClassScope = (Class)methParent.GetParent(); // // EXPERIMENTAL: The signature of the methParent must be // visible as the signature of this MethodSpec. The type-actuals // are held in the instTypes array. this.sig = this.methParent.GetSig(buff); instTypes = buff.ReadMethSpecSig(instIx); this.unresolved = false; // buff.currentMethodScope = null; buff.currentClassScope = null; }
internal void SetMethParam(Method paren, int ix) { typeIndex = MVAR; parent = paren; index = (ushort)ix; }
internal MethSig ReadMethSig(Method thisMeth, uint blobIx) { Contract.Requires(thisMeth != null); Contract.Ensures(Contract.Result<MethSig>() != null); blob.GoToIndex(blobIx); uint blobSize = blob.ReadCompressedNum(); return ReadMethSig(thisMeth, false); }
internal MethSig ReadMethSig(Method thisMeth, string name, uint blobIx) { Contract.Requires(thisMeth != null); Contract.Requires(name != null); Contract.Ensures(Contract.Result<MethSig>() != null); blob.GoToIndex(blobIx); uint blobSize = blob.ReadCompressedNum(); MethSig mSig = ReadMethSig(thisMeth, false); mSig.name = name; return mSig; }
/*-------------------- Constructors ---------------------------------*/ public MethInstr(MethodOp inst, Method m) : base((uint)inst) { meth = m; size += 4; }
public void SetMethod(Method mth) { meth = mth; }
/// <summary> /// Add an instruction with a method parameter /// </summary> /// <param name="inst">the CIL instruction</param> /// <param name="m">the method parameter</param> public void MethInst(MethodOp inst, Method m) { Contract.Requires(m != null); if (m is MethodDef) if (((MethodDef)m).GetScope() != thisMeth.GetScope()) throw new DescriptorException(); AddToBuffer(new MethInstr(inst, m)); }
/*-------------------- Constructors ---------------------------------*/ /// <summary> /// Create a new function pointer type /// </summary> /// <param name="meth">the function to be referenced</param> public MethPtrType(Method meth) : base((byte)ElementType.FnPtr) { this.meth = meth; }
/// <summary> /// Open a method. Scopes and sequence points will be added to this method. /// </summary> /// <param name="token">The token for this method.</param> public void OpenMethod(int token) { // Add this new method to the list of methods Method meth = new Method(); meth.Token = new SymbolToken(token); methods.Add(meth); // Set the current method currentMethod = meth; }
private MethSig ReadMethSig(Method currMeth, bool firstByteRead)
/// <summary> /// Close the current method. /// </summary> public void CloseMethod() { // Make sure a method is open if (currentMethod == null) throw new Exception("No methods currently open."); // Check to make sure all scopes have been closed. if (currentScope != null) throw new Exception("Can not close method until all scopes are closed. Method Token: " + currentMethod.Token.ToString()); // Change the current method to null currentMethod = null; }
/*-------------------- Constructors ---------------------------------*/ public MethodSpec(Method mParent, Type[] instTypes) : base(null) { this.methParent = mParent; this.instTypes = instTypes; tabIx = MDTable.MethodSpec; }
internal CustomAttribute(MetaDataElement paren, Method constrType, byte[] val)