Beispiel #1
0
        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);
        }