Beispiel #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();
        }
Beispiel #2
0
 // Constructor
 public GuiSystem(ILockingComponent lockingComponent,
                  IToolbarComponent toolbarComponent,
                  IWindowListComponent windowListComponent,
                  IFindProgramComponent findProgramComponent,
                  ILockWindowComponent lockWindowComponent,
                  IAboutComponent aboutComponent,
                  ISettingsComponent settingsComponent,
                  IMainWindowComponent mainWindowComponent)
 {
     _lockingComponent     = lockingComponent;
     _toolbarComponent     = toolbarComponent;
     _windowListComponent  = windowListComponent;
     _findProgramComponent = findProgramComponent;
     _lockWindowComponent  = lockWindowComponent;
     _aboutComponent       = aboutComponent;
     _settingsComponent    = settingsComponent;
     _mainWindowComponent  = mainWindowComponent;
 }