Example #1
0
 private void addOrReplaceCompiledKnowlegeBase(string stPath, CompiledKnowledgeBase ckb)
 {
     if (ckb != null)
     {
         if (!compiledKnowledgeBases.ContainsKey(stPath))
         {
             this.compiledKnowledgeBases.Add(stPath, ckb);
         }
         else
         {
             this.compiledKnowledgeBases[stPath] = ckb;
         }
     }
 }
Example #2
0
 public void SaveEncryptedCompiledKnowledgeBase(CompiledKnowledgeBase ckb, string stPath)
 {
     BinaryFormatter bf = new BinaryFormatter();
     FileStream fs = new FileStream(stPath, FileMode.Create);
     CryptoStream csEncrypt = new CryptoStream(fs, this.encryptor, CryptoStreamMode.Write);
     bf.Serialize(csEncrypt, ckb);
     csEncrypt.FlushFinalBlock();
     fs.Flush();
     fs.Close();
 }
Example #3
0
 public void SaveCompiledKnowledgeBase(CompiledKnowledgeBase ckb, string stPath)
 {
     BinaryFormatter bf = new BinaryFormatter();
     FileStream fs = new FileStream(stPath, FileMode.Create);
     bf.Serialize(fs, ckb);
     fs.Close();
 }
Example #4
0
 public void RemoveCompiledKnowledgeBase(CompiledKnowledgeBase ckb)
 {
     string stPath = ckb.KnowledgeBaseItem.Fullpath+ckb.KnowledgeBaseItem.Filename;
     this.RemoveCompiledKnowledgeBase(stPath);
 }
Example #5
0
 public CompiledKnowledgeBase LoadKnowledgeBase(KnowledgeBase kb, KnowledgeBaseItem knowledgeBaseItem)
 {
     CompiledKnowledgeBase ckb = new CompiledKnowledgeBase();
     ckb.Build = kb.Build;
     ckb.Name = knowledgeBaseItem.Fullpath + knowledgeBaseItem.Filename;
     ckb.OnRuleCompiled += new CompiledKnowledgeBase.RuleCompiled(this.compiledKnowledgeBase_OnRuleCompiled);
     ckb.OnRuleCompileFailed += new CompiledKnowledgeBase.RuleCompileFailed(this.compiledKnowledgeBase_OnRuleCompileFailed);
     ckb.OnCompileError += new Conversive.Verbot5.CompiledKnowledgeBase.CompileError(ckb_OnCompileError);
     ckb.OnCompileWarning += new Conversive.Verbot5.CompiledKnowledgeBase.CompileWarning(ckb_OnCompileWarning);
     ckb.LoadKnowledgeBase(kb, knowledgeBaseItem);
     return ckb;
 }
Example #6
0
 public void AddOrReplaceCompiledKnowlegeBase(string stPath, CompiledKnowledgeBase ckb)
 {
     this.addOrReplaceCompiledKnowlegeBase(stPath, ckb);
 }