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()); } } } }
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); }
public List <ListBoxAppModel> GetVisibleApps() { return(WindowsManager.GetAllWindows()); }