private void OpenApps(List <AppModel> requestedApps)
        {
            var groupedApps = requestedApps.GroupBy(x => x.FilePath);

            foreach (var groupedApp in groupedApps)
            {
                int neededToOpen = groupedApp.Count() - WindowsManager.GetAllWindows(groupedApp.First().Name).Count;
                if (neededToOpen > 0)
                {
                    for (int i = 0; i < neededToOpen; i++)
                    {
                        StartApp(groupedApp.First());
                    }
                }
            }
        }
Esempio n. 2
0
        private static IntPtr GetValidWindowToMove(AppModel app)
        {
            List <IntPtr> allAppWindows = WindowsManager.GetAllWindows(app.Name);

            if (IsWindowAlreadyPlaced(allAppWindows, app, out IntPtr placedWindow))
            {
                return(placedWindow);
            }

            foreach (IntPtr window in allAppWindows)
            {
                if (!PlacedWindows.Contains(window))
                {
                    PlacedWindows.Add(window);
                    return(window);
                }
            }
            return(IntPtr.Zero);
        }
Esempio n. 3
0
 public List <ListBoxAppModel> GetVisibleApps()
 {
     return(WindowsManager.GetAllWindows());
 }