Ejemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (ofd.ShowDialog() == DialogResult.OK)
     {
         currentPath = ofd.FileName;
         Text        = $"Словарик {currentPath.Split('\\')[currentPath.Split('\\').Length - 1]}";
         var allText = File.ReadAllText(ofd.FileName);
         words      = allText.Split('\\')[1];
         structType = allText.Split('\\')[0];
         definitions.AddRange(File.ReadAllLines($"{ofd.FileName}.definitions"));
         try
         {
             structure = Deserealize(words); //AVLTree<string>
             if (structure != null)
             {
                 fillTreeView(structure.ToString(), Text);
             }
             button4.Enabled = true;
             button5.Enabled = true;
         }
         catch (Exception)
         {
             MessageBox.Show("Неверный тип структуры данных");
         }
     }
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Writer writer = new FormWriter();

            writer.Write(structure.ToString(), this);
        }