public static void StartServices(IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit) { ProjectsManager projectsManager; /* Start TemplatesService */ ts = new TemplatesService(Config.configDirectory); Core.mainWindow.TemplatesService = ts; /* Start DB services */ db = new DataBase(Path.Combine(Config.DBDir(),Constants.DB_FILE)); /* Start the events manager */ eManager = new EventsManager(guiToolkit); /* Start the hotkeys manager */ hkManager = new HotKeysManager(guiToolkit.MainWindow); hkManager.newMarkEvent += eManager.OnNewTag; /* Start the rendering jobs manager */ videoRenderer = new RenderingJobsManager(multimediaToolkit, guiToolkit); /* Start Game Units manager */ guManager = new GameUnitsManager(mainWindow, mainWindow.Player); /* Start playlists manager */ plManager = new PlaylistManager(guiToolkit, videoRenderer); projectsManager = new ProjectsManager(guiToolkit, multimediaToolkit); projectsManager.OpenedProjectChanged += OnOpenedProjectChanged; }
public static void RegisterServices (IGUIToolkit guiToolkit, IMultimediaToolkit multimediaToolkit) { App.Current.DependencyRegistry.Register<IStorageManager, CouchbaseManagerLongoMatch> (1); App.Current.DependencyRegistry.Register<IFileStorage, LMFileStorage> (1); App.Current.MultimediaToolkit = multimediaToolkit; App.Current.GUIToolkit = guiToolkit; App.Current.EventsBroker = new EventsBroker (); App.Current.EventsBroker.Subscribe<QuitApplicationEvent> (HandleQuitApplicationEvent); /* Start DB services */ dbManager = new DataBaseManager (); RegisterService (dbManager); ts = new TemplatesService (); RegisterService (ts); /* Start the rendering jobs manager */ jobsManagerVM = new JobsManagerVM { Model = new RangeObservableCollection<Job> () }; App.Current.JobsManager = jobsManagerVM; RenderingJobsController jobsController = new RenderingJobsController (jobsManagerVM); RegisterService (jobsController); projectsManager = new ProjectsManager (); RegisterService (projectsManager); /* State the tools manager */ toolsManager = new ToolsManager (); RegisterService (toolsManager); ProjectsImporter = toolsManager; /* Start the events manager */ eManager = new EventsManager (); RegisterService (eManager); RegisterService (new CoreEventsManager ()); /* Start the hotkeys manager */ hkManager = new HotKeysManager (); RegisterService (hkManager); /* Start playlists hotkeys manager */ plManager = new PlaylistManager (); RegisterService (plManager); }