Esempio n. 1
0
        private void StartSystem()
        {
            // Bind handlers
            Exit += App_Exit;
            DispatcherUnhandledException += App_DispatcherUnhandledException;

            // Create system objects
            foregroundWindowHook = new ForegroundWindowHook();
            windowUpdateHook     = new WindowUpdateHook();
            mouseHook            = new ClipMouseHook();
            appSystem            = new AppSystem(foregroundWindowHook, windowUpdateHook, mouseHook);
            windowEnumerator     = new WindowEnumerator();

            // Create components
            lockingComponent     = new LockingComponent(appSystem);
            toolbarComponent     = new ToolbarComponent();
            windowListComponent  = new WindowListComponent(windowEnumerator);
            findProgramComponent = new FindProgramComponent();
            lockWindowComponent  = new LockWindowComponent(appSystem);
            aboutComponent       = new AboutComponent();
            settingsComponent    = new SettingsComponent();
            mainWindowComponent  = new MainWindowComponent(appSystem);

            // Create gui system
            guiSystem = new GuiSystem(lockingComponent, toolbarComponent, windowListComponent, findProgramComponent, lockWindowComponent, aboutComponent, settingsComponent, mainWindowComponent);
            guiSystem.Startup();
        }