private void AppM_OnProcessStarted(Application app) { if (!app.IsSystemApp) { AppTaskbar.AddTaskBarItem(app); app.AppWindowLogic.WindowState = Default; ShowWindow(app); } app.AppWindowLogic.OnWindowAction += AppWindowLogic_OnWindowAction; }
private void _appM_OnProcessResume(Application app) { if (app.IsSystemApp && app.AppWindowLogic.WindowState == None) { AppTaskbar.AddTaskBarItem(app); app.AppWindowLogic.WindowState = Default; } app.AppWindowLogic.WindowState &= ~Minimize; //Display App Refernece Window ShowWindow(app); }
private void CloseApp(Application app) { AppView.Children.Clear(); AppTaskbar.RemoveTaskBarItem(app.AppProcess.ProcessID); if (app.IsSystemApp) { app.AppWindowLogic.WindowState = None; } else { _appM.EndAppProcess(app.AppProcess.ProcessID); } }
/// <summary> /// Register Callbacks on Processs Start, Resume, TaskBar Items and Desktop Icon Clicks/Request /// </summary> private void RegisterEvents() { _appM.OnProcessStarted += AppM_OnProcessStarted; _appM.OnAppClearUp += (app) => AppTaskbar.RemoveTaskBarItem(app.AppProcess.ProcessID); _appM.OnProcessResume += _appM_OnProcessResume; AppTaskbar.TaskBarItemOpened += (pid) => _appM.ResumeProcess(pid); AppTaskbar.TaskBarItemClosed += CloseApp; memory.OnAppLaunchRequest += (app) => _appM.ResumeProcess(0); process.OnAppLaunchRequest += (app) => _appM.ResumeProcess(1); disk.OnAppLaunchRequest += (app) => _appM.ResumeProcess(2); tick.OnAppLaunchRequest += (app) => _appM.AddProcess(Applications.TicTacToeApp); }