Exemple #1
0
        protected override bool IsAcceptableWritingProperty(IPropertySymbol prop)
        {
            if (!prop.AreGetterAndSetterAvailable())
            {
                return(false);
            }

            //Since we are looking into custom deserialization, we are allowing interface and abstract types
            //(the custom serializer will pick the right concrete type).
            return(true);
        }
Exemple #2
0
        protected virtual bool IsAcceptableWritingProperty(IPropertySymbol prop)
        {
            if (!prop.AreGetterAndSetterAvailable())
            {
                return(false);
            }

            // We should always generate serializer for collections (includes IEnumerable and IDictionary)
            if (prop.IsCollection())             //includes: || prop.IsDictionary())
            {
                return(true);
            }

            return(!prop.Type.IsAbstract &&
                   prop.Type.TypeKind != TypeKind.Interface);
        }