Is Integer Number Type - CSharp System.Reflection

CSharp examples for System.Reflection:Type

Description

Is Integer Number Type

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using System.Reflection.Emit;
using System.Reflection;
using System.Linq;
using System.IO;/*w  w  w.  j  a v  a2  s. c o m*/
using System.Globalization;
using System.Collections.Generic;
using System;

public class Main{
        public static bool IsIntegerNumberType(this Type t)
        {
            return
                t == typeof(byte) ||
                t == typeof(sbyte) ||
                t == typeof(short) ||
                t == typeof(ushort) ||
                t == typeof(int) ||
                t == typeof(uint) ||
                t == typeof(long) ||
                t == typeof(ulong);
        }
}

Related Tutorials