Exemplo n.º 1
0
        public void AddTab(string tabName)
        {
            var wordtab = new Wordtab();

            _words.Add(tabName, wordtab);
            wordtab.FillTab(new string[0]);

            SaveWords();
        }
Exemplo n.º 2
0
        private void LoadWords()
        {
            _words = new Dictionary <string, Wordtab>();

            if (!File.Exists(_dataFilePath))
            {
                AddTab("Словарь");
                return;
            }

            string data = File.ReadAllText(_dataFilePath, Encoding.Unicode);

            string[] tabsInfos = data.Split(new [] { "\r\n" }, System.StringSplitOptions.RemoveEmptyEntries);

            foreach (string tabInfo in tabsInfos)
            {
                string[] tabInfoArr = tabInfo.Split(new[] { "<^&^>" }, 2, System.StringSplitOptions.None);

                var wordtab = new Wordtab();
                _words.Add(tabInfoArr[0], wordtab);
                wordtab.FillTab(tabInfoArr[1].Split(new[] { "<-&&->" }, System.StringSplitOptions.None));
            }
        }