Example #1
0
        private void tsmiFile_Open_Click(object sender, EventArgs e)
        {
            KB.Clear();
            lvFactBase.Items.Clear();
            lvRuleBase.Items.Clear();
            lvFactBase.Refresh();
            lvRuleBase.Refresh();

            if (ofdOpen.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    KB = (new FileLoader(ofdOpen.FileName)).Load();
                    foreach (EBCell Cell in KB.BaseOfFacts)
                    {
                        AddExpressionToListView(lvFactBase, Cell.Value);
                    }
                    foreach (EBCell Cell in KB.BaseOfRules)
                    {
                        AddExpressionToListView(lvRuleBase, Cell.Value);
                    }
                }
                catch (Exception Exc)
                {
                    MessageBox.Show(Exc.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }