public SerializationContext()
        {
            _outputTypeComment = true;
            _outputTypeInformation = true;
            _referenceWritingType = ReferenceOption.ErrorCircularReferences;

            _typeAliases = new TypeAliasCollection();

            // collections
            _collectionHandlers = new List<CollectionHandler>();
            _collectionHandlers.Add(new GenericCollectionHandler());
            _collectionHandlers.Add(new ArrayHandler());
            _collectionHandlers.Add(new ListHandler());
            _collectionHandlers.Add(new StackHandler());
            _collectionHandlers.Add(new GenericStackHandler());
            _collectionHandlers.Add(new CollectionConstructorHandler());

            // type handlers
            _typeHandlerFactory = new TypeDataRepository(this);
            _parameters = new Hashtable();

            // type conversion
            _typeHandlerFactory.RegisterTypeConverter(typeof(System.Collections.BitArray), new BitArrayConverter());

            this.expressionHandlers = new ExpressionHandlerCollection(this);
        }
Exemplo n.º 2
0
        public SerializationContext()
        {
            _outputTypeComment     = true;
            _outputTypeInformation = true;
            _referenceWritingType  = ReferenceOption.ErrorCircularReferences;

            _typeAliases = new TypeAliasCollection();

            // collections
            _collectionHandlers = new List <CollectionHandler>();
            _collectionHandlers.Add(new GenericCollectionHandler());
            _collectionHandlers.Add(new ArrayHandler());
            _collectionHandlers.Add(new ListHandler());
            _collectionHandlers.Add(new StackHandler());
            _collectionHandlers.Add(new GenericStackHandler());
            _collectionHandlers.Add(new CollectionConstructorHandler());

            // type handlers
            _typeHandlerFactory = new TypeDataRepository(this);
            _parameters         = new Hashtable();

            // type conversion
            _typeHandlerFactory.RegisterTypeConverter(typeof(System.Collections.BitArray), new BitArrayConverter());

            this.expressionHandlers = new ExpressionHandlerCollection(this);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates an instead of serializer settings with default values
        /// </summary>
        public SerializerSettings()
        {
            OutputTypeInformation = true;
            IgnoredPropertyAction = IgnoredPropertyOption.ThrowException;
            MissingPropertyAction = MissingPropertyOptions.Ignore;
            ReferenceWritingType  = ReferenceOption.ErrorCircularReferences;
            DefaultValueSetting   = DefaultValueOption.WriteAllValues;

            TypeAliases = new TypeAliasCollection();

            // collections
            CollectionHandlers = new List <CollectionHandler>();
            CollectionHandlers.Add(new GenericCollectionHandler());
            CollectionHandlers.Add(new ArrayHandler());
            CollectionHandlers.Add(new ListHandler());
            CollectionHandlers.Add(new StackHandler());
            CollectionHandlers.Add(new GenericStackHandler());
            CollectionHandlers.Add(new CollectionConstructorHandler());

            // type handlers
            Types      = new TypeDataRepository(this);
            Parameters = new Hashtable();

            // type conversion
            Types.RegisterTypeConverter(typeof(System.Collections.BitArray), new BitArrayConverter());

            ExpressionHandlers = new ExpressionHandlerCollection(this);
            DefaultValues      = new DefaultValueCollection();
        }