static public void Serialize(KnowlegeBase kb) { XmlSerializer formatter = new XmlSerializer(typeof(KnowlegeBase)); using (FileStream fs = new FileStream(rulesFilePath, FileMode.Create)) { formatter.Serialize(fs, kb); } }
static public void Serialize(KnowlegeBase kb) { XmlSerializer formatter = new XmlSerializer(typeof(KnowlegeBase)); using (FileStream fs = new FileStream(rulesFilePath, FileMode.Create)) { formatter.Serialize(fs, kb); } }
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); }
/// <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(); }
/// <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(); }
/// <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(); }
/// <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(); }
/// <summary> /// конструктор окна редактирования /// </summary> public EditDB() { InitializeComponent(); knowlegeBase = XMLDataLoader.Deserialize(); Load_CB(); }
/// <summary> /// конструктор окна редактирования /// </summary> public EditDB() { InitializeComponent(); knowlegeBase = XMLDataLoader.Deserialize(); Load_CB(); }