/// <summary>
        /// Gets flags set on an enum property
        /// </summary>
        /// <param name="p">The propertyInfo</param>
        /// <param name="target">The instance of the object</param>
        /// <returns>A list of the set enum values</returns>
        public static IEnumerable <EnumValue> GetFlags(this IMetaProperty p, IMetaObject target)
        {
            if (p is null)
            {
                throw new System.ArgumentNullException(nameof(p));
            }

            if (target is null)
            {
                throw new System.ArgumentNullException(nameof(target));
            }

            if (!p.Type.HasAttribute <FlagsAttribute>())
            {
                throw new ArgumentException($"Property type {p.Type.FullName} does not have flags attribute");
            }

            long l = p.GetValue(target).Convert <long>();

            foreach (EnumValue thisValue in p.Type.Values)
            {
                long thisVal = thisValue.Value.Convert <long>();

                if (TestFlags(l, thisVal))
                {
                    yield return(thisValue);
                }
            }
        }
        /// <summary>
        /// Gets flags set on an enum property
        /// </summary>
        /// <param name="p">The propertyInfo</param>
        /// <param name="target">The instance of the object</param>
        /// <param name="otherFlags">returns a long representing the value of all flags on the object value that aren't declared explicitely</param>
        /// <returns>A list of the set enum values</returns>
        public static IList <EnumValue> GetFlags(this IMetaProperty p, IMetaObject target, out long otherFlags)
        {
            otherFlags = p.GetValue(target).Convert <long>();

            List <EnumValue> toReturn = new List <EnumValue>();

            foreach (EnumValue thisValue in p.GetFlags(target))
            {
                toReturn.Add(thisValue);

                otherFlags &= ~thisValue.Value.Convert <long>();
            }

            return(toReturn);
        }