Beispiel #1
0
        private Func <string, object> TryGetDeserializer(Type type)
        {
            if (TypeDeserializers.TryGetValue(type, out var deserializer))
            {
                return(deserializer);
            }

            return(type.IsEnum ? Deserializers.Enum(type) : null);
        }
Beispiel #2
0
        public static IValueProvider GetIconResource(object value)
        {
            if (value is - 1 || value is string s && string.Equals(s, "empty", StringComparison.OrdinalIgnoreCase))
            {
                return(new LiteralValue((PackIconKind)(-1)));
            }

            return(GetResource <PackIconKind>(value, (PackIconKind)(-2), Deserializers.Enum <PackIconKind>()));
        }