System.Diagnostics.SwitchAttribute.GetAll C# (CSharp) Method

GetAll() public static method

public static GetAll ( Assembly assembly ) : System.Diagnostics.SwitchAttribute[]
assembly System.Reflection.Assembly
return System.Diagnostics.SwitchAttribute[]
        public static SwitchAttribute[] GetAll(Assembly assembly)
        {
            if (assembly == null)
                throw new ArgumentNullException(nameof(assembly));

            List<object> switchAttribs = new List<object>();
            object[] attribs = assembly.GetCustomAttributes(typeof(SwitchAttribute), false);
            switchAttribs.AddRange(attribs);

            foreach (Type type in assembly.GetTypes())
            {
                GetAllRecursive(type, switchAttribs);
            }

            SwitchAttribute[] ret = new SwitchAttribute[switchAttribs.Count];
            switchAttribs.CopyTo(ret, 0);
            return ret;
        }

Same methods

SwitchAttribute::GetAll ( System assembly ) : System.Diagnostics.SwitchAttribute[]