Ejemplo n.º 1
0
 private void AppM_OnProcessStarted(Application app)
 {
     if (!app.IsSystemApp)
     {
         AppTaskbar.AddTaskBarItem(app);
         app.AppWindowLogic.WindowState = Default;
         ShowWindow(app);
     }
     app.AppWindowLogic.OnWindowAction += AppWindowLogic_OnWindowAction;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
        /// <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);
        }