Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/09 11:00:29 (15 years ago)
Author:
epitzer
Message:

Better formatting configuration interface. (#506)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New Persistence Exploration/Persistence/Persistence/DeSerializer.cs

    r1357 r1358  
    7777    private readonly Dictionary<Type, Handler> handlers;
    7878    private readonly Stack<IAccessibleObject> compositeStack;
    79     private readonly PersistenceConfiguration persistenceConfiguration;
     79    private readonly Configuration configuration;
    8080    private readonly Dictionary<int, Type> typeIds;   
    8181    private List<Thunk> finalFixes;
     
    8383    public DeSerializer(
    8484      IEnumerable<KeyValuePair<string, int>> typeCache,
    85       PersistenceConfiguration persistenceConfiguration) {
    86       this.persistenceConfiguration = persistenceConfiguration;
     85      Configuration configuration) {
     86      this.configuration = configuration;
    8787      id2obj = new Dictionary<int, object>();
    8888      compositeStack = new Stack<IAccessibleObject>();
     
    116116      object instance;     
    117117      Type type = typeIds[(int)start.TypeId];
    118       if (persistenceConfiguration.GetDecomposer(type) != null) {
     118      if (configuration.GetDecomposer(type) != null) {
    119119        instance = new ParentReference();
    120120        compositeStack.Push(new CustomObject(instance));       
     
    132132      EndToken end = (EndToken)token;
    133133      Type type = typeIds[(int)end.TypeId];
    134       IDecomposer decomposer = persistenceConfiguration.GetDecomposer(type);
     134      IDecomposer decomposer = configuration.GetDecomposer(type);
    135135      if (decomposer != null) {
    136136        CustomObject customObject = (CustomObject)compositeStack.Pop();
     
    150150      PrimitiveToken primitive = (PrimitiveToken)token;
    151151      Type type = typeIds[(int)primitive.TypeId];
    152       object value = persistenceConfiguration
    153         .GetFormatter(XmlFormat.Instance, type)
     152      object value = configuration
     153        .GetFormatter(type)
    154154        .DeSerialize(primitive.SerialData);
    155155      if ( ! value.GetType().IsValueType )
Note: See TracChangeset for help on using the changeset viewer.