コード例 #1
0
        private void InheritAttributes(IReflectionInfo test)
        {
            var otherAttributes = test.GetCustomAttributes <DependantAttribute>(true);

            var newSetupTypes = new List <Type>(this.ExecuteInSetupTypes);

            foreach (var otherAttribute in otherAttributes)
            {
                if (otherAttribute.Inherit)
                {
                    foreach (var otherSetupType in otherAttribute.ExecuteInSetupTypes)
                    {
                        if (!newSetupTypes.Contains(otherSetupType))
                        {
                            newSetupTypes.Add(otherSetupType);
                        }
                    }
                }
            }
            ExecuteInSetupTypes = newSetupTypes.ToArray();
        }
コード例 #2
0
 private static bool IsFrozen(IReflectionInfo reflectionInfo)
 {
     return(reflectionInfo.GetCustomAttributes <FrozenAttribute>(true).Any());
 }
コード例 #3
0
 private static bool IsFrozen(IReflectionInfo reflectionInfo) => reflectionInfo.GetCustomAttributes<FrozenAttribute>(true).Any();