Example #1
0
        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));
        }
Example #2
0
        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();
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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);
        }
Example #5
0
 public void Merge(Top p_other)
 {
     WindowPositions.Union(p_other.WindowPositions);
     WindowConfigurations.Union(p_other.WindowConfigurations);
     Arrangements.Union(p_other.Arrangements);
 }