/// <summary> /// Default Constructor /// </summary> public StrategyController() { IPersistRepository <object> persistRepository = ContextRegistry.GetContext()["PersistRepository"] as IPersistRepository <object>; // Save UI thread reference _currentDispatcher = Dispatcher.CurrentDispatcher; PersistencePublisher.InitializeDisruptor(persistRepository); }
/// <summary> /// Starts Communicator to open communication medium with clients /// </summary> public void StartCommunicator() { // Check for Null Reference if (_communicator != null) { // Connect Communication Server _communicator.Connect(); IPersistRepository <object> persistRepository = ContextRegistry.GetContext()["PersistRepository"] as IPersistRepository <object>; PersistencePublisher.InitializeDisruptor(true, persistRepository); } }
/// <summary> /// Execute selected strategy /// </summary> private void RunSelectedStrategy(string key) { try { IPersistRepository <object> persistRepository = ContextRegistry.GetContext()["PersistRepository"] as IPersistRepository <object>; PersistencePublisher.InitializeDisruptor(EnablePersistence, persistRepository); if (Logger.IsInfoEnabled) { Logger.Info("Going to execute the selected strategy: ", _type.FullName, "RunSelectedStrategy"); } // Create new instance to pass to event aggregator RunStrategy runStrategy = new RunStrategy(key); // Publish event to notify listeners EventSystem.Publish <RunStrategy>(runStrategy); } catch (Exception exception) { Logger.Error(exception, _type.FullName, "RunSelectedStrategy"); } }