UnityEditor.EditorExtensionMethods.EnumGetNonObsoleteValues C# (CSharp) Method

EnumGetNonObsoleteValues() private method

private EnumGetNonObsoleteValues ( Type type ) : List
type System.Type
return List
        internal static List<Enum> EnumGetNonObsoleteValues(Type type)
        {
            string[] names = Enum.GetNames(type);
            Enum[] enumArray = Enumerable.ToArray<Enum>(Enumerable.Cast<Enum>(Enum.GetValues(type)));
            List<Enum> list = new List<Enum>();
            for (int i = 0; i < names.Length; i++)
            {
                object[] customAttributes = type.GetMember(names[i])[0].GetCustomAttributes(typeof(ObsoleteAttribute), false);
                bool flag = false;
                foreach (object obj2 in customAttributes)
                {
                    if (obj2 is ObsoleteAttribute)
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    list.Add(enumArray[i]);
                }
            }
            return list;
        }