Esempio n. 1
0
        private void init(byte[] k, byte[] v)
        {
            this.compiledKnowledgeBases = new Dictionary <string, CompiledKnowledgeBase>();
            xmlToolbox = new XMLToolbox(typeof(KnowledgeBase));
            RijndaelManaged crypto = new RijndaelManaged();

            this.encryptor = crypto.CreateEncryptor(k, v);
            this.decryptor = crypto.CreateDecryptor(k, v);
        }
Esempio n. 2
0
        }//loadReplacementProfiles(List<ResourceFile> resourceFiles)

        private void loadCodeModules(List <ResourceFile> resourceFiles)
        {
            XMLToolbox xmlToolbox = new XMLToolbox(typeof(CodeModule));
            CodeModule cm;

            foreach (ResourceFile rf in resourceFiles)
            {
                if (rf.Filetype == ResourceFileType.CodeModuleFile)
                {
                    cm = (CodeModule)xmlToolbox.LoadXML(this.knowledgeBaseItem.Fullpath + rf.Filename);
                    this.csToolbox.AddCodeModule(cm);
                }        //end if ReplacementProfileFile
            }            //foreach resource file
        }//loadCodeModules(List<ResourceFile> resourceFiles)
Esempio n. 3
0
        }//loadSynonyms(List<ResourceFile> resourceFiles)

        private void loadReplacementProfiles(List <ResourceFile> resourceFiles)
        {
            XMLToolbox         xmlToolbox = new XMLToolbox(typeof(ReplacementProfile));
            ReplacementProfile rp;

            foreach (ResourceFile rf in resourceFiles)
            {
                if (rf.Filetype == ResourceFileType.ReplacementProfileFile)
                {
                    rp = (ReplacementProfile)xmlToolbox.LoadXML(this.knowledgeBaseItem.Fullpath + rf.Filename);
                    this.replacements.AddRange(rp.Replacements);
                    this.inputReplacements.AddRange(rp.InputReplacements);
                }        //end if ReplacementProfileFile
            }            //foreach resource file
        }//loadReplacementProfiles(List<ResourceFile> resourceFiles)
Esempio n. 4
0
        }//LoadResourceFiles(List<ResourceFile> resourceFiles)

        private void loadSynonyms(List <ResourceFile> resourceFiles)
        {
            XMLToolbox   xmlToolbox = new XMLToolbox(typeof(SynonymGroup));
            SynonymGroup sg;

            foreach (ResourceFile rf in resourceFiles)
            {
                if (rf.Filetype == ResourceFileType.SynonymFile)
                {
                    sg = (SynonymGroup)xmlToolbox.LoadXML(this.knowledgeBaseItem.Fullpath + rf.Filename);
                    foreach (Synonym s in sg.Synonyms)
                    {
                        s.Phrases.Sort();
                        this.synonyms[s.Name.ToLower()] = s;
                    }
                }        //end if SynonymFile
            }            //foreach resource file
        }//loadSynonyms(List<ResourceFile> resourceFiles)
Esempio n. 5
0
 private void loadSynonyms(List<ResourceFile> resourceFiles)
 {
     XMLToolbox xmlToolbox = new XMLToolbox(typeof(SynonymGroup));
     SynonymGroup sg;
     foreach(ResourceFile rf in resourceFiles)
     {
         if(rf.Filetype == ResourceFileType.SynonymFile)
         {
             sg = (SynonymGroup)xmlToolbox.LoadXML(this.knowledgeBaseItem.Fullpath + rf.Filename);
             foreach(Synonym s in sg.Synonyms)
             {
                 s.Phrases.Sort();
                 this.synonyms[s.Name.ToLower()] = s;
             }
         }//end if SynonymFile
     }//foreach resource file
 }
Esempio n. 6
0
 private void loadReplacementProfiles(List<ResourceFile> resourceFiles)
 {
     XMLToolbox xmlToolbox = new XMLToolbox(typeof(ReplacementProfile));
     ReplacementProfile rp;
     foreach(ResourceFile rf in resourceFiles)
     {
         if(rf.Filetype == ResourceFileType.ReplacementProfileFile)
         {
             rp = (ReplacementProfile)xmlToolbox.LoadXML(this.knowledgeBaseItem.Fullpath + rf.Filename);
             this.replacements.AddRange(rp.Replacements);
             this.inputReplacements.AddRange(rp.InputReplacements);
         }//end if ReplacementProfileFile
     }//foreach resource file
 }
Esempio n. 7
0
 private void loadCodeModules(List<ResourceFile> resourceFiles)
 {
     XMLToolbox xmlToolbox = new XMLToolbox(typeof(CodeModule));
     CodeModule cm;
     foreach(ResourceFile rf in resourceFiles)
     {
         if(rf.Filetype == ResourceFileType.CodeModuleFile)
         {
             cm = (CodeModule)xmlToolbox.LoadXML(this.knowledgeBaseItem.Fullpath + rf.Filename);
             this.csToolbox.AddCodeModule(cm);
         }//end if ReplacementProfileFile
     }//foreach resource file
 }
Esempio n. 8
0
 private void init(byte[] k, byte[] v)
 {
     this.compiledKnowledgeBases = new Dictionary<string,CompiledKnowledgeBase>();
     xmlToolbox = new XMLToolbox(typeof(KnowledgeBase));
     RijndaelManaged crypto = new RijndaelManaged();
     this.encryptor = crypto.CreateEncryptor(k, v);
     this.decryptor = crypto.CreateDecryptor(k, v);
 }