System.Reflection.PseudoCustomAttribute.IsSecurityAttribute C# (CSharp) Method

IsSecurityAttribute() static private method

static private IsSecurityAttribute ( Type type ) : bool
type System.Type
return bool
        internal static bool IsSecurityAttribute(Type type)
        {
            return type == typeof(SecurityAttribute) || type.IsSubclassOf(typeof(SecurityAttribute));
        }

Usage Example

Esempio n. 1
0
        internal static Attribute[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType, bool includeSecCa, out int count)
        {
            count = 0;
            bool flag = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);

            if (!flag && PseudoCustomAttribute.s_pca.GetValueOrDefault(caType) == null && !PseudoCustomAttribute.IsSecurityAttribute(caType))
            {
                return(new Attribute[0]);
            }
            List <Attribute> list = new List <Attribute>();

            if (includeSecCa && (flag || PseudoCustomAttribute.IsSecurityAttribute(caType)))
            {
                object[] array;
                PseudoCustomAttribute.GetSecurityAttributes(ctor.Module.ModuleHandle.GetRuntimeModule(), ctor.MetadataToken, false, out array);
                if (array != null)
                {
                    foreach (object obj in array)
                    {
                        if (caType == obj.GetType() || obj.GetType().IsSubclassOf(caType))
                        {
                            list.Add((Attribute)obj);
                        }
                    }
                }
            }
            count = list.Count;
            return(list.ToArray());
        }
All Usage Examples Of System.Reflection.PseudoCustomAttribute::IsSecurityAttribute