コード例 #1
0
        public IReadOnlyList <Enum> GetRequiredMethodPermissions(Type type, IMethodInformation methodInformation)
        {
            ArgumentUtility.CheckNotNull("type", type);
            ArgumentUtility.CheckNotNull("methodInformation", methodInformation);

            if (methodInformation.IsNull)
            {
                return(s_emptyPermissions);
            }

            var permissionAttribute = methodInformation.GetCustomAttribute <DemandPermissionAttribute> (true);

            if (permissionAttribute == null)
            {
                return(s_emptyPermissions);
            }

            return(permissionAttribute.GetAccessTypes().Distinct().ToArray());
        }
コード例 #2
0
 public T GetCustomAttribute <T> (bool inherited) where T : class
 {
     return(_implementationMethodInfo.GetCustomAttribute <T>(inherited));
 }