Exemplo n.º 1
0
        private static Settings Deserialize(string fileName)
        {
            var doc = new XmlDocument { XmlResolver = null };
            using (var stream = File.OpenRead(fileName))
            {
                doc.Load(stream);
            }
            var settings = new Settings(fileName);

            XmlNode node = doc.DocumentElement.SelectSingleNode("RecentFolders");
            if (node != null)
            {
                foreach (XmlNode subnode in node.SelectNodes("Path"))
                {
                    settings.RecentFolders.Add(subnode.InnerText);
                }
            }

            return settings;
        }
Exemplo n.º 2
0
        private void Main_Load(object sender, EventArgs e)
        {
            _settings = Configuration.Settings;
            var recentFolders = _settings.RecentFolders;
            var maxCount = toolStripMenuItemFileRecentFolders.DropDownItems.Count;
            while (recentFolders.Count > maxCount)
                recentFolders.RemoveAt(0);
            recentFolders.Capacity = maxCount;

            toolStripMenuItemFile.ToolTipText = "Subtitle Edit “Dictionaries” folder not found";
            InitializeWordListView(GetDictionaryPath());
        }