Exemplo n.º 1
0
        private static IEnumerable <Delegate> ExtractPrivateFieldValues(object instance, bool ensureMaximumOfOne, AttributeFullName attributeFullName)
        {
            var details = FieldInspectionArguments <Delegate> .CreateFromInstance(instance, ensureMaximumOfOne, attributeFullName);

            CollectFieldDetails(details);

            return(details.Items);
        }
        static void CollectFieldDetails <T>(FieldInspectionArguments <T> inspection)
        {
            if (inspection.CannotProceed)
            {
                return;
            }

            inspection.CollectFieldValue();
            CollectFieldDetails(inspection.DetailsForBaseType());

            if (inspection.IsNested)
            {
                CollectFieldDetails(inspection.DetailsForDeclaringType());
            }
        }