Beispiel #1
0
        public override bool CheckType(CheckTypeInfo info)
        {
            if (info.Type.IsArray)
            {
                return(true);
            }

            if (info.Type == typeof(Array))
            {
                _info.Type = ArrayType.Unknown;
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        public override bool CheckType(CheckTypeInfo info)
        {
            if (info.Type == typeof(string))
            {
                _type = StringType.String;
            }
            else if (info.Type == typeof(StringBuilder))
            {
                _type = StringType.StringBuilder;
            }
            else if (info.Type == typeof(char[]))
            {
                _type = StringType.CharArray;
            }
            else
            {
                return(false);
            }

            return(true);
        }
Beispiel #3
0
 public override bool CheckType(CheckTypeInfo info) => typeof(IEnumerable).IsAssignableFrom(info.Type);
Beispiel #4
0
 /// <summary>
 /// Check whether the converter supports a given type, used for non-exact types.
 /// This method is allowed to modify variables, however it is nt.
 /// </summary>
 public virtual bool CheckType(CheckTypeInfo info) => throw new Exception("Converter says it also converts non-exact but does not override 'CheckType' to check for one.");
Beispiel #5
0
 public override bool CheckType(CheckTypeInfo info) => info.Type.IsPrimitive;
Beispiel #6
0
 public override bool CheckType(CheckTypeInfo info) =>
 ObjectEligibilityChecker.CheckIfEligibleAndGetSaveMode(info.Type, out _saveMode);