Ejemplo n.º 1
0
        private static List <RuleSetInfoCollection> GetDependentRuleSetsOnVocabulary(string brlFileName)
        {
            List <RuleSetInfoCollection> list = new List <RuleSetInfoCollection>();
            FileRuleStore            frs      = new FileRuleStore(brlFileName);
            VocabularyInfoCollection coll     = frs.GetVocabularies(RuleStore.Filter.All);

            foreach (VocabularyInfo item in coll)
            {
                list.Add(frs.GetDependentRuleSets(item));
            }
            return(list);
        }
Ejemplo n.º 2
0
        public static Vocabulary[] LoadVocabFromFile(string filename, string vocabName)
        {
            RuleStore store = new FileRuleStore(filename);
            VocabularyInfoCollection vocabularies = store.GetVocabularies(vocabName, RuleStore.Filter.All);

            if (vocabularies.Count < 1)
            {
                throw new ApplicationException(string.Format("EXCEPTION: No Vocabulary named {0} exists in rule store {1}", vocabName, filename));
            }
            Vocabulary[] vocabularyArray = new Vocabulary[vocabularies.Count];
            for (int i = 0; i < vocabularies.Count; i++)
            {
                vocabularyArray[i] = store.GetVocabulary(vocabularies[i]);
            }
            return(vocabularyArray);
        }