コード例 #1
0
        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());
                    }
                }
            }
        }
コード例 #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);
        }
コード例 #3
0
 public List <ListBoxAppModel> GetVisibleApps()
 {
     return(WindowsManager.GetAllWindows());
 }