Esempio n. 1
0
        public static VariableDefinition GetVariable(this Editor_Mono.Cecil.Cil.MethodBody self, int index)
        {
            Collection <VariableDefinition> variables = self.Variables;

            if (index < 0 || index >= variables.size)
            {
                return(null);
            }
            return(variables[index]);
        }
Esempio n. 2
0
        public static ParameterDefinition GetParameter(this Editor_Mono.Cecil.Cil.MethodBody self, int index)
        {
            MethodDefinition method = self.method;

            if (method.HasThis)
            {
                if (index == 0)
                {
                    return(self.ThisParameter);
                }
                index--;
            }
            Collection <ParameterDefinition> parameters = method.Parameters;

            if (index < 0 || index >= parameters.size)
            {
                return(null);
            }
            return(parameters[index]);
        }
Esempio n. 3
0
 internal ILProcessor(MethodBody body)
 {
     this.body         = body;
     this.instructions = body.Instructions;
 }