/// <summary> /// 枚举值解析 /// </summary> /// <param name="xmlDeSerializer">XML 反序列化</param> /// <param name="value">目标数据</param> internal static void DeSerializeFlags(XmlDeSerializer xmlDeSerializer, ref T value) { if (!tryDeSerializeNumber(xmlDeSerializer, ref value)) { if (enumSearcher.State == null) { if (xmlDeSerializer.Config.IsMatchEnum) { xmlDeSerializer.State = DeSerializeState.NoFoundEnumValue; } else { xmlDeSerializer.IgnoreSearchValue(); } } else { int index, nextIndex = -1; getIndex(xmlDeSerializer, ref value, out index, ref nextIndex); if (nextIndex != -1) { ulong intValue = enumInts.ULong[index]; intValue |= enumInts.ULong[nextIndex]; while (xmlDeSerializer.IsNextFlagEnum() != 0) { if ((index = enumSearcher.NextFlagEnum(xmlDeSerializer)) != -1) { intValue |= enumInts.ULong[index]; } } value = AutoCSer.Metadata.EnumGenericType <T, ulong> .FromInt(intValue); } } } }