Beispiel #1
0
        public static OpCodeGroup GetGroupOfOpCode(OpCode opCode)
        {
            OpCodeGroup result = OpCodeGroup.Parameterless;

            if (FieldParameter.Contains(opCode))
            {
                result = OpCodeGroup.FieldParameter;
            }
            else if (MethodParameter.Contains(opCode))
            {
                result = OpCodeGroup.MethodParameter;
            }
            else if (StringParameter.Contains(opCode))
            {
                result = OpCodeGroup.StringParameter;
            }
            else if (TypeParameter.Contains(opCode))
            {
                result = OpCodeGroup.TypeParameter;
            }
            else if (SbyteLocationParameter.Contains(opCode))
            {
                result = OpCodeGroup.SbyteLocationParameter;
            }
            else if (IntLocationParameter.Contains(opCode))
            {
                result = OpCodeGroup.IntLocationParameter;
            }
            else if (ByteParameter.Contains(opCode))
            {
                result = OpCodeGroup.ByteParameter;
            }
            else if (UshortParameter.Contains(opCode))
            {
                result = OpCodeGroup.UshortParameter;
            }
            else if (SbyteParameter.Contains(opCode))
            {
                result = OpCodeGroup.SbyteParameter;
            }
            else if (IntParameter.Contains(opCode))
            {
                result = OpCodeGroup.IntParameter;
            }
            else if (LongParameter.Contains(opCode))
            {
                result = OpCodeGroup.LongParameter;
            }
            else if (FloatParameter.Contains(opCode))
            {
                result = OpCodeGroup.FloatParameter;
            }
            else if (DoubleParameter.Contains(opCode))
            {
                result = OpCodeGroup.DoubleParameter;
            }
            else if (ByteArgumentParameter.Contains(opCode))
            {
                result = OpCodeGroup.ByteArgumentParameter;
            }
            else if (UshortArgumentParameter.Contains(opCode))
            {
                result = OpCodeGroup.UshortArgumentParameter;
            }
            else if (ByteVariableParameter.Contains(opCode))
            {
                result = OpCodeGroup.ByteVariableParameter;
            }
            else if (UshortVariableParameter.Contains(opCode))
            {
                result = OpCodeGroup.UshortVariableParameter;
            }
            else if (opCode.Equals(OpCodes.Calli))
            {
                result = OpCodeGroup.Calli;
            }
            else if (opCode.Equals(OpCodes.Switch))
            {
                result = OpCodeGroup.Switch;
            }
            else if (opCode.Equals(OpCodes.Ldtoken))
            {
                result = OpCodeGroup.Ldtoken;
            }

            return(result);
        }