Example #1
0
        private void TSMI_PROFILE_Click(object sender, EventArgs e)
        {
            string profilePath = (sender as ToolStripDropDownItem).ToolTipText;

            if (File.Exists(profilePath))
            {
                XPathDocument     xpDoc      = new XPathDocument(profilePath);
                XPathNavigator    navProfile = xpDoc.CreateNavigator().SelectSingleNode("SRWE/Profile");
                XPathNodeIterator iterator   = navProfile.Select("Window");

                UncheckTreeViewNodes(TV_WINDOW_TREE.Nodes);

                while (iterator.MoveNext())
                {
                    UpdateWindowFromProfile(iterator.Current);
                }

                SRWE_Settings.AddRecentProfile(profilePath);                 // Brings profile to TOP of the Recent Profiles list.
            }
            else
            {
                SRWE_Settings.RemoveRecentProfile(profilePath);
            }

            RefreshRecentProfilesMenu();
        }
Example #2
0
 private void AttachToProcess(Process toAttachTo)
 {
     m_selectedProcess = toAttachTo;
     UpdateCaption();
     UpdateWindowTree();
     SRWE_Settings.AddRecentProcess(m_selectedProcess.ProcessName);
 }
Example #3
0
        private void TSI_PROFILE_SAVE_Click(object sender, EventArgs e)
        {
            if (SFD_PROFILE.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            MemoryStream ms     = new MemoryStream(Properties.Resources.XML_Profile);
            XmlDocument  xmlDoc = new XmlDocument();

            xmlDoc.Load(ms);
            ms.Close();

            XmlElement xmlProfile = xmlDoc.DocumentElement["Profile"];

            AddWindowsToProfile(xmlProfile, TV_WINDOW_TREE.Nodes);
            xmlDoc.Save(SFD_PROFILE.FileName);

            SRWE_Settings.AddRecentProfile(SFD_PROFILE.FileName);
            RefreshRecentProfilesMenu();
        }
Example #4
0
        private void TSI_PROFILE_LOAD_Click(object sender, EventArgs e)
        {
            if (OFD_PROFILE.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            XPathDocument     xpDoc      = new XPathDocument(OFD_PROFILE.FileName);
            XPathNavigator    navProfile = xpDoc.CreateNavigator().SelectSingleNode("SRWE/Profile");
            XPathNodeIterator iterator   = navProfile.Select("Window");

            UncheckTreeViewNodes(TV_WINDOW_TREE.Nodes);

            while (iterator.MoveNext())
            {
                UpdateWindowFromProfile(iterator.Current);
            }

            SRWE_Settings.AddRecentProfile(OFD_PROFILE.FileName);
            RefreshRecentProfilesMenu();
        }