public override IYamlSerializable TryCreate(SerializerContext context, ITypeDescriptor typeDescriptor)
        {
            if (CanVisit(typeDescriptor.Type))
                return this;

            return null;
        }
Esempio n. 2
0
        public override IYamlSerializable TryCreate(SerializerContext context, ITypeDescriptor typeDescriptor)
        {
            if (CanVisit(typeDescriptor.Type))
            {
                return(this);
            }

            return(null);
        }
        /// <inheritdoc/>
        public override IYamlSerializable TryCreate(SerializerContext context, ITypeDescriptor typeDescriptor)
        {
            // Accepts any type inheriting from AssetComposite
            if (typeof(AssetComposite).IsAssignableFrom(typeDescriptor.Type))
            {
                return(this);
            }

            // Accepts any type known as asset part type for the current asset type.
            if (localContext.Value != null && localContext.Value.References.Any(x => x.ReferenceableType.IsAssignableFrom(typeDescriptor.Type)))
            {
                return(this);
            }

            return(null);
        }
Esempio n. 4
0
 public IYamlSerializable TryCreate(SerializerContext context, ITypeDescriptor typeDescriptor)
 {
     return(CanVisit(typeDescriptor.Type) ? this : null);
 }
 public override IYamlSerializable TryCreate(SerializerContext context, ITypeDescriptor typeDescriptor)
 {
     var type = typeDescriptor.Type;
     return CanVisit(type) ? this : null;
 }
 public IYamlSerializable TryCreate(SerializerContext context, ITypeDescriptor typeDescriptor)
 {
     return CanVisit(typeDescriptor.Type) ? this : null;
 }