static public HashSet <WindowHandle> ApplyLocatedWindow(Config.Top p_config, Config.LocatedWindow p_locatedWindow, HashSet <WindowHandle> p_exclude = null) { Config.Location loc = p_config.GetLocation(p_locatedWindow.LocationGUID); Config.Window win = p_config.GetWindow(p_locatedWindow.WindowGUID); return(ApplyModification(win, loc, p_locatedWindow.AllowMultipleMatches, p_exclude)); }
void loadConfig(Stream fs, bool replace = true) { XmlSerializer serializer; try { serializer = new XmlSerializer(typeof(Config.Top)); } catch (Exception e) { serializer = null; } config = (Config.Top)serializer.Deserialize(fs); fs.Close(); }
void loadConfigFromIsolatedStorage() { IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null); try { if (isoStore.FileExists(configFile)) { IsolatedStorageFileStream fs = new IsolatedStorageFileStream(configFile, FileMode.Open, isoStore); loadConfig(fs, true); } else { config = new Config.Top(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
static public void ApplyArrangement(Config.Top p_config, Config.Arrangement p_arrangement) { HashSet <WindowHandle> matchedWindows = new HashSet <WindowHandle>(); IntPtr hwnd = IntPtr.Zero; foreach (Config.LocatedWindow locWin in p_arrangement.WindowPositions) { HashSet <WindowHandle> thisLocWinMatches = ApplyLocatedWindow(p_config, locWin, matchedWindows); if (p_arrangement.SetZIndex) { foreach (WindowHandle wHand in thisLocWinMatches) { wHand.SetZPosition(hwnd); hwnd = wHand.RawPtr; } } matchedWindows.UnionWith(thisLocWinMatches); } HandleNonMatchingWindows(p_arrangement, matchedWindows); }
public void Merge(Top p_other) { WindowPositions.Union(p_other.WindowPositions); WindowConfigurations.Union(p_other.WindowConfigurations); Arrangements.Union(p_other.Arrangements); }