Is Integer Type - CSharp System

CSharp examples for System:Type

Description

Is Integer Type

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Linq.Expressions;
using System.Linq;
using System.Collections.Generic;
using System;//from   ww  w . ja v  a2  s  . c om
using SafeILGenerator.Ast.Nodes;

public class Main{
    static public bool IsIntegerType(Type Type)
      {
         if (Type == typeof(sbyte) || Type == typeof(byte)) return true;
         if (Type == typeof(short) || Type == typeof(ushort)) return true;
         if (Type == typeof(int) || Type == typeof(uint)) return true;
         if (Type == typeof(long) || Type == typeof(ulong)) return true;
         return false;
      }
}

Related Tutorials