static bool LiveOrDead(Duck ducks) { Type t = typeof(Duck); object[] b = t.GetCustomAttributes(false); foreach (DeadOrLiveDuckAttribute deadOrLiveDuckAttribute in b) { if (ducks.Live == deadOrLiveDuckAttribute.Live) { return(true); } else { return(false); } } return(true); }