Create() public static méthode

public static Create ( Type type ) : Microsoft.Scripting.Interpreter.Instruction
type System.Type
Résultat Microsoft.Scripting.Interpreter.Instruction
Exemple #1
0
 public void EmitAdd(Type type, bool @checked)
 {
     if (@checked)
     {
         Emit(AddOvfInstruction.Create(type));
     }
     else
     {
         Emit(AddInstruction.Create(type));
     }
 }
Exemple #2
0
        public static Instruction Create(Type type)
        {
            Debug.Assert(type.IsArithmetic());
            switch (type.GetNonNullableType().GetTypeCode())
            {
            case TypeCode.Int16: return(_Int16 ?? (_Int16 = new AddOvfInt16()));

            case TypeCode.Int32: return(_Int32 ?? (_Int32 = new AddOvfInt32()));

            case TypeCode.Int64: return(_Int64 ?? (_Int64 = new AddOvfInt64()));

            case TypeCode.UInt16: return(_UInt16 ?? (_UInt16 = new AddOvfUInt16()));

            case TypeCode.UInt32: return(_UInt32 ?? (_UInt32 = new AddOvfUInt32()));

            case TypeCode.UInt64: return(_UInt64 ?? (_UInt64 = new AddOvfUInt64()));

            default:
                return(AddInstruction.Create(type));
            }
        }