예제 #1
0
 public void ActivateAspects(UnmarshallingContext context)
 {
     var schemaUpdateDetected = new BooleanByRef();
     var savedState = context.SaveState();
     ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_63(context
         , schemaUpdateDetected, EnsureFieldList(context));
     // TODO: cant the aspect handle it itself?
     // Probably no because old aspect versions might not be able
     // to handle null...
     TraverseAllAspects(context, command);
     if (schemaUpdateDetected.value)
     {
         context.RestoreState(savedState);
         command = new _MarshallingInfoTraverseAspectCommand_94(context, EnsureFieldList(context
             ));
         TraverseAllAspects(context, command);
     }
 }
예제 #2
0
 private object InstantiateWithCustomTypeHandler(UnmarshallingContext context)
 {
     var contextState = context.SaveState();
     try
     {
         var fieldHasValue = SeekToField(context, _customTypeHandlerAspect);
         if (!fieldHasValue)
         {
             context.RestoreState(contextState);
             return InstantiateForVersionWithoutCustomTypeHandler(context);
         }
         var customTypeHandler = (IInstantiatingTypeHandler) _customTypeHandlerAspect
             ._typeHandler;
         return context.SlotFormat().DoWithSlotIndirection(context, new _IClosure4_2055(customTypeHandler
             , context));
     }
     finally
     {
         context.RestoreState(contextState);
     }
 }