コード例 #1
0
ファイル: XMLDataLoader.cs プロジェクト: i-Living/Smart-IS
 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
ファイル: XMLDataLoader.cs プロジェクト: i-Living/Smart-IS
        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
ファイル: XMLDataLoader.cs プロジェクト: i-Living/Smart-IS
        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
ファイル: MainWindow.xaml.cs プロジェクト: i-Living/Smart-IS
 /// <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
ファイル: MainWindow.xaml.cs プロジェクト: i-Living/Smart-IS
 /// <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
ファイル: MainWindow.xaml.cs プロジェクト: i-Living/Smart-IS
 /// <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
ファイル: MainWindow.xaml.cs プロジェクト: i-Living/Smart-IS
 /// <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
ファイル: EditDB.xaml.cs プロジェクト: i-Living/Smart-IS
 /// <summary>
 /// конструктор окна редактирования
 /// </summary>
 public EditDB()
 {
     InitializeComponent();
     knowlegeBase = XMLDataLoader.Deserialize();
     Load_CB();
 }
コード例 #9
0
ファイル: EditDB.xaml.cs プロジェクト: i-Living/Smart-IS
 /// <summary>
 /// конструктор окна редактирования
 /// </summary>
 public EditDB()
 {
     InitializeComponent();
     knowlegeBase = XMLDataLoader.Deserialize();
     Load_CB();
 }