Пример #1
0
 static public void Serialize(KnowlegeBase kb)
 {
     XmlSerializer formatter = new XmlSerializer(typeof(KnowlegeBase));
     using (FileStream fs = new FileStream(rulesFilePath, FileMode.Create))
     {
         formatter.Serialize(fs, kb);
     }
 }
Пример #2
0
        static public void Serialize(KnowlegeBase kb)
        {
            XmlSerializer formatter = new XmlSerializer(typeof(KnowlegeBase));

            using (FileStream fs = new FileStream(rulesFilePath, FileMode.Create))
            {
                formatter.Serialize(fs, kb);
            }
        }
Пример #3
0
        static public KnowlegeBase Deserialize()
        {
            KnowlegeBase  result    = null;
            XmlSerializer formatter = new XmlSerializer(typeof(KnowlegeBase));

            using (FileStream fs = new FileStream(rulesFilePath, FileMode.OpenOrCreate))
            {
                result = (KnowlegeBase)formatter.Deserialize(fs);
            }
            return(result);
        }
Пример #4
0
 /// <summary>
 /// запуск программы заного
 /// </summary>
 public void Again()
 {
     knowlegeBase = XMLDataLoader.Deserialize();
     knowlegeBase.LoadRules();
     workMemory     = new WorkMemory(knowlegeBase.Facts);
     confirmedFacts = new List <Fact>();
     title          = string.Empty;
     ybtn.IsEnabled = true;
     nbtn.IsEnabled = true;
     ExplW.Clear();
     Run();
 }
Пример #5
0
 /// <summary>
 /// конструктор окна
 /// </summary>
 public MainWindow()
 {
     InitializeComponent();
     knowlegeBase = XMLDataLoader.Deserialize();
     knowlegeBase.LoadRules();
     workMemory     = new WorkMemory(knowlegeBase.Facts);
     confirmedFacts = new List <Fact>();
     facts          = new List <string>();
     ExplW          = new ExplanationWindow();
     title          = string.Empty;
     Run();
 }
Пример #6
0
 /// <summary>
 /// запуск программы заного
 /// </summary>
 public void Again()
 {
     knowlegeBase = XMLDataLoader.Deserialize();
     knowlegeBase.LoadRules();
     workMemory = new WorkMemory(knowlegeBase.Facts);
     confirmedFacts = new List<Fact>();
     title = string.Empty;
     ybtn.IsEnabled = true;
     nbtn.IsEnabled = true;
     ExplW.Clear();
     Run();
 }
Пример #7
0
 /// <summary>
 /// конструктор окна
 /// </summary>
 public MainWindow()
 {
     InitializeComponent();
     knowlegeBase = XMLDataLoader.Deserialize();
     knowlegeBase.LoadRules();
     workMemory = new WorkMemory(knowlegeBase.Facts);
     confirmedFacts = new List<Fact>();
     facts = new List<string>();
     ExplW = new ExplanationWindow();
     title = string.Empty;
     Run();
 }
Пример #8
0
 /// <summary>
 /// конструктор окна редактирования
 /// </summary>
 public EditDB()
 {
     InitializeComponent();
     knowlegeBase = XMLDataLoader.Deserialize();
     Load_CB();
 }
Пример #9
0
 /// <summary>
 /// конструктор окна редактирования
 /// </summary>
 public EditDB()
 {
     InitializeComponent();
     knowlegeBase = XMLDataLoader.Deserialize();
     Load_CB();
 }