SORU
27 NİSAN 2010, Salı


Eğer Türü örnek C null bir numaralama olup olmadığını kontrol etme#

Nasıl bir Tip C null bir numaralama ise kontrol edebilirim# gibi bir şey

Type t = GetMyType();
bool isEnum = t.IsEnum; //Type member
bool isNullableEnum = t.IsNullableEnum(); How to implement this extension method?

CEVAP
27 NİSAN 2010, Salı


public static bool IsNullableEnum(this Type t)
{
    Type u = Nullable.GetUnderlyingType(t);
    return (u != null) && u.IsEnum;
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Jucyber Tutoriais

    Jucyber Tuto

    8 EYLÜL 2009
  • justintimberlakeVEVO

    justintimber

    2 EYLÜL 2009
  • Random Act of Kindness Video Contest

    Random Act o

    18 EYLÜL 2012