public static ValueSerializerContext Create(PrefixLookup prefixLookup, XamlSchemaContext schemaContext, Func <IAmbientProvider> ambientProvider, IProvideValueTarget provideValue, IRootObjectProvider rootProvider, IDestinationTypeProvider destinationProvider, IXamlObjectWriterFactory objectWriterFactory)
        {
            var context = new ValueSerializerContext();

            context.Initialize(prefixLookup, schemaContext, ambientProvider, provideValue, rootProvider, destinationProvider, objectWriterFactory);
            return(context);
        }
Exemple #2
0
        public static ValueSerializerContext Create(PrefixLookup prefixLookup, XamlSchemaContext schemaContext, Func <IAmbientProvider> ambientProvider, IProvideValueTarget provideValue, IRootObjectProvider rootProvider, IDestinationTypeProvider destinationProvider, IXamlObjectWriterFactory objectWriterFactory)
        {
#if !HAS_TYPE_CONVERTER
            ValueSerializerContext context;
            var type = GetValueSerializerType();
            if (type != null)
            {
                context = Activator.CreateInstance(type) as ValueSerializerContext;
            }
            else
            {
                context = new ValueSerializerContext();
            }
#else
            var context = new ValueSerializerContext();
#endif
            context.Initialize(prefixLookup, schemaContext, ambientProvider, provideValue, rootProvider, destinationProvider, objectWriterFactory);
            return(context);
        }