Exemplo n.º 1
0
        private bool IsDefaultValueValid(string itemType, string value, ParsingIndex index)
        {
            if (ParsingHelper.IsPrimitive(itemType))
            {
                return(ParsingHelper.IsPrimitiveValueValid(itemType, value));
            }

            if (_externStructs.TryGetValue(itemType, out var externStructInfo))
            {
                return(externStructInfo.Values.Contains(value));
            }

            if (index.ContainsEnum(itemType))
            {
                return(index.IsEnumContainsItem(itemType, value));
            }

            return(false);
        }
Exemplo n.º 2
0
        private static bool IsEnumValueValid(string enumName, string value, ParsingIndex index)
        {
            var underlyingType = index.GetEnumUnderlyingType(enumName);

            return(ParsingHelper.IsPrimitiveValueValid(underlyingType, value));
        }