Ejemplo n.º 1
0
        private void addProgram(Process aProc)
        {
            WindowsProgram addProgram = new WindowsProgram()
            {
                Id = WindowsProgram.NextId(SelectedProfile.Id)
            };

            addProgram.StartPath    = aProc.MainModule.FileName;
            addProgram.WindowWidth  = WindowController.GetWindowWidth(aProc);
            addProgram.WindowHeight = WindowController.GetWindowHeight(aProc);
            addProgram.XPos         = WindowController.WindowXPosition(aProc);
            addProgram.YPos         = WindowController.WindowYPosition(aProc);
            addProgram.WindowState  = WindowController.GetWindowStatus(aProc);
            addProgram.ProcessName  = aProc.ProcessName;

            if (aProc.ProcessName == "chrome")
            {
                ReturnStringDialogViewModel ArgumentSetter = new ReturnStringDialogViewModel("Chrome website", "Which website should be opened when chrome is launched?");
                if (ArgumentSetter.DialogResult == 1)
                {
                    addProgram.Argument = ArgumentSetter.Value;
                }
            }

            Configuration.ProfileById(SelectedProfile.Id).Programs.Add(addProgram);
            Configuration.Save();
        }