public static void HandleEvent(Event @event) { IEventEmitter eventEmitter = DIExtensions.Container.GetInstance <IEventEmitter>(); eventEmitter.EmitEvent(@event); PersistenceExtensions.OpenTransaction(); DIExtensions.Container.GetInstance <EventDispatcher>().DispatchEvents(); PersistenceExtensions.CommitTransaction(); }
/// <summary> /// Creates a new sound module (corresponding to a new track) on the DAW /// </summary> /// <param name="client"></param> /// <param name="senderID"> The id to give the sound module</param> public void CreateSoundModule(string senderID) { Protocol.Module.CreateSoundModule createEvent = new Protocol.Module.CreateSoundModule { SenderId = senderID }; Protocol.ModuleEvent moduleEvent = new Protocol.ModuleEvent { HandlerId = "app", CreateSoundModuleEvent = createEvent }; Protocol.Event remoteEvent = new Protocol.Event { ModuleEvent = moduleEvent, MethodName = "CreateSoundModule" }; Emitter.EmitEvent(remoteEvent); }
protected void EmitEvent(Event e) { _eventEmitter.EmitEvent(e); }