Exemplo n.º 1
0
        public void Handle(IResolveEvent rEvent)
        {
            IResolveState newState = CurrentState.Handle(rEvent, Owner, this, Session);

            history.Add(new HistoryEvent(CurrentState, newState, rEvent, FullTrace));
            CurrentState = newState;
        }
 public IResolveState Handle(IResolveEvent rEvent, INakedObjectAdapter owner, IResolveStateMachine rsm, ISession s)
 {
     if (EventMap.ContainsKey(rEvent))
     {
         return(EventMap[rEvent](owner, rsm, s));
     }
     throw new ResolveException(Log.LogAndReturn($"Unknown event {rEvent} in state {this}"));
 }
Exemplo n.º 3
0
 public IResolveState Handle(IResolveEvent rEvent, INakedObject owner, IResolveStateMachine rsm, ISession s)
 {
     if (EventMap.ContainsKey(rEvent))
     {
         return(EventMap[rEvent](owner, rsm, s));
     }
     throw new ResolveException(string.Format("Unknown event {0} in state {1}", rEvent, this));
 }
Exemplo n.º 4
0
 public INakedObject AdapterFor(Object obj, IResolveEvent resolveEvent) {
     if (adapters.ContainsKey(obj)) {
         return adapters[obj];
     } else {
         IOid oid = SerialOid.CreatePersistent(nextId++, obj.GetType().FullName);
         INakedObject adapterFor = new ProgrammableNakedObject(obj, reflector.LoadSpecification(obj.GetType()), oid);
         adapterFor.ResolveState.Handle(resolveEvent);
         adapters[obj] = adapterFor;
         return adapterFor;
     }
 }
Exemplo n.º 5
0
 public HistoryEvent(IResolveState startState, IResolveState endState, IResolveEvent rEvent, bool fullTrace)
 {
     StartState = startState;
     EndState   = endState;
     Event      = rEvent;
     TimeStamp  = DateTime.Now;
     Notes      = new List <string>();
     if (fullTrace)
     {
         trace = new StackTrace(2, true);
     }
 }
Exemplo n.º 6
0
 static Events() {
     DestroyEvent = new ResolveStateMachine.DestroyEvent();
     EndPartResolvingEvent = new ResolveStateMachine.EndPartResolvingEvent();
     EndResolvingEvent = new ResolveStateMachine.EndResolvingEvent();
     EndSerializingEvent = new ResolveStateMachine.EndSerializingEvent();
     EndUpdatingEvent = new ResolveStateMachine.EndUpdatingEvent();
     InitializeAggregateEvent = new ResolveStateMachine.InitializeAggregateEvent();
     InitializePersistentEvent = new ResolveStateMachine.InitializePersistentEvent();
     InitializeTransientEvent = new ResolveStateMachine.InitializeTransientEvent();
     ResetEvent = new ResolveStateMachine.ResetEvent();
     StartPartResolvingEvent = new ResolveStateMachine.StartPartResolvingEvent();
     StartResolvingEvent = new ResolveStateMachine.StartResolvingEvent();
     StartSerializingEvent = new ResolveStateMachine.StartSerializingEvent();
     StartUpdatingEvent = new ResolveStateMachine.StartUpdatingEvent();
     StartSetupEvent = new ResolveStateMachine.StartSetupEvent();
     StartPartSetupEvent = new ResolveStateMachine.StartPartSetupEvent();
     EndSetupEvent = new ResolveStateMachine.EndSetupEvent();
     EndPartSetupEvent = new ResolveStateMachine.EndPartSetupEvent();
 }
Exemplo n.º 7
0
 static Events()
 {
     DestroyEvent              = new ResolveStateMachine.DestroyEvent();
     EndPartResolvingEvent     = new ResolveStateMachine.EndPartResolvingEvent();
     EndResolvingEvent         = new ResolveStateMachine.EndResolvingEvent();
     EndSerializingEvent       = new ResolveStateMachine.EndSerializingEvent();
     EndUpdatingEvent          = new ResolveStateMachine.EndUpdatingEvent();
     InitializeAggregateEvent  = new ResolveStateMachine.InitializeAggregateEvent();
     InitializePersistentEvent = new ResolveStateMachine.InitializePersistentEvent();
     InitializeTransientEvent  = new ResolveStateMachine.InitializeTransientEvent();
     ResetEvent = new ResolveStateMachine.ResetEvent();
     StartPartResolvingEvent = new ResolveStateMachine.StartPartResolvingEvent();
     StartResolvingEvent     = new ResolveStateMachine.StartResolvingEvent();
     StartSerializingEvent   = new ResolveStateMachine.StartSerializingEvent();
     StartUpdatingEvent      = new ResolveStateMachine.StartUpdatingEvent();
     StartSetupEvent         = new ResolveStateMachine.StartSetupEvent();
     StartPartSetupEvent     = new ResolveStateMachine.StartPartSetupEvent();
     EndSetupEvent           = new ResolveStateMachine.EndSetupEvent();
     EndPartSetupEvent       = new ResolveStateMachine.EndPartSetupEvent();
 }
 public HistoryEvent(IResolveState startState, IResolveState endState, IResolveEvent rEvent, bool fullTrace) {
     StartState = startState;
     EndState = endState;
     Event = rEvent;
     TimeStamp = DateTime.Now;
     Notes = new List<string>();
     if (fullTrace) {
         Trace = new StackTrace(2, true);
     }
 }
 public void Handle(IResolveEvent rEvent) {
     IResolveState newState = CurrentState.Handle(rEvent, Owner, this);
     history.Add(new HistoryEvent(CurrentState, newState, rEvent, FullTrace));
     CurrentState = newState;
 }
 public IResolveState Handle(IResolveEvent rEvent, INakedObject owner, IResolveStateMachine rsm) {
     if (EventMap.ContainsKey(rEvent)) {
         return EventMap[rEvent](owner, rsm);
     }
     throw new ResolveException(string.Format("Unknown event {0} in state {1}", rEvent, this));
 }
 public IResolveState Handle(IResolveEvent rEvent, INakedObjectAdapter owner, IResolveStateMachine rsm, ISession s) {
     if (EventMap.ContainsKey(rEvent)) {
         return EventMap[rEvent](owner, rsm, s);
     }
     throw new ResolveException(Log.LogAndReturn($"Unknown event {rEvent} in state {this}"));
 }