Esempio n. 1
0
        private void LoadFastFormula()
        {
            if (fastformulaCB.Items.Count == 0 || fastformulaCB.Text.Length == 0)
            {
                return;
            }

            Formulas.Clear();
            var path = "";

            foreach (var s in Directory.GetFiles(FormulaFolderAbsPath))
            {
                if (s.EndsWith("\\" + fastformulaCB.Text))
                {
                    path = s;
                    break;
                }
            }
            if (String.IsNullOrEmpty(path))
            {
                return;
            }
            var listf = Formula.Deserialise(path);

            foreach (var f in listf)
            {
                Formulas.Add(f);
            }
        }
Esempio n. 2
0
 public FormulaEditor(String rootFolders, Form1 baseform1, List <Formula> f)
 {
     init(rootFolders, baseform1);
     try
     {
         Formula.Deserialise(f, ref formulapanel);
     }
     catch (Exception)
     {
         MessageBox.Show("Error loading file");
         Clear();
     }
 }
Esempio n. 3
0
        private void loadformula_Click(object sender, EventArgs e)
        {
            if (loadedformulas.SelectedItems.Count != 1)
            {
                return;
            }

            var s = loadedformulas.SelectedItems[0].Name;

            try
            {
                Formula.Deserialise(s, ref formulapanel);
            }
            catch (Exception)
            {
                MessageBox.Show("Error loading file");
                Clear();
            }
        }