Beispiel #1
0
        private IEnumerable <CilMethodDefinition> GetMethodDefinitions()
        {
            var handles = _typeDefinition.GetMethods();

            foreach (var handle in handles)
            {
                var method = _readers.MdReader.GetMethodDefinition(handle);
                yield return(CilMethodDefinition.Create(method, MetadataTokens.GetToken(handle), ref _readers, this));
            }
        }
 internal static CilMethodDefinition Create(MethodDefinition methodDefinition, int token, ref CilReaders readers, CilTypeDefinition typeDefinition)
 {
     CilMethodDefinition method = new CilMethodDefinition();
     method._methodDefinition = methodDefinition;
     method._token = token;
     method._typeDefinition = typeDefinition;
     method._readers = readers;
     method._provider = readers.Provider;
     method._rva = -1;
     method._methodDeclarationToken = -1;
     method._isIlReaderInitialized = false;
     method._isSignatureInitialized = false;
     method._isImportInitialized = false;
     if(method.RelativeVirtualAddress != 0)
         method._methodBody = method._readers.PEReader.GetMethodBody(method.RelativeVirtualAddress);
     return method;
 }
        internal static CilMethodDefinition Create(MethodDefinition methodDefinition, int token, ref CilReaders readers, CilTypeDefinition typeDefinition)
        {
            CilMethodDefinition method = new CilMethodDefinition();

            method._methodDefinition = methodDefinition;
            method._token            = token;
            method._typeDefinition   = typeDefinition;
            method._readers          = readers;
            method._provider         = readers.Provider;
            method._rva = -1;
            method._methodDeclarationToken = -1;
            method._isIlReaderInitialized  = false;
            method._isSignatureInitialized = false;
            method._isImportInitialized    = false;
            if (method.RelativeVirtualAddress != 0)
            {
                method._methodBody = method._readers.PEReader.GetMethodBody(method.RelativeVirtualAddress);
            }
            return(method);
        }
Beispiel #4
0
 public MethodNode(CilMethodDefinition methodDef)
 {
     _methodDef = methodDef;
 }