CSharp examples for Reflection:Attribute
Has Attribute for MemberInfo
// Redistribution and use in source and binary forms, with or without modification, using System.Collections.Generic; using System.Reflection; using System;/*from w w w .j ava 2s . c o m*/ public class Main{ internal static bool HasAttribute(MemberInfo member) { object[] attributes = member.GetCustomAttributes(typeof(CsvIgnore), false); return (attributes != null && attributes.Length > 0); } }