Beispiel #1
0
        private static bool FilterMethodForTarget(MethodInfo configure, ITarget target)
        {
            Configure configureAttribute = ConfigureCollection.GetConfigureAttribute(configure, inherit: true);

            if (configureAttribute?.Flags != null)
            {
                foreach (object fragmentValue in configureAttribute.Flags)
                {
                    if (!target.AndMask(fragmentValue))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Beispiel #2
0
        private static bool FilterMethodForTarget(MethodInfo configure, ITarget target)
        {
            object[] attributes = s_cachedMethodInfoToConfigureAttributes.GetOrAdd(configure, c => configure.GetCustomAttributes(typeof(Configure), true));
            foreach (Configure configureAttribute in attributes)
            {
                if (configureAttribute.Flags != null)
                {
                    foreach (object fragmentValue in configureAttribute.Flags)
                    {
                        if (!target.AndMask(fragmentValue))
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }