private XmlGenerator BuildXmlGenerator()
        {
            var cache = new DataCache();
            var rfp   = new RuleToFunctorParser(cache);

            rfp.CreateFunctors(null);

            return(new XmlGenerator(rfp, Ukprn));
        }
示例#2
0
 private void SetUpFunctorDataGrid()
 {
     _cache         = new DataCache();
     _rfp           = new RuleToFunctorParser(_cache);
     _functorCount  = 0;
     _totalLearners = 0;
     _rfp.CreateFunctors(AddFunctor);
     uiRuleData.Text = $"Discrete rules {uiParameters.Rows.Count} functors detected: {_functorCount} total learners: {_totalLearners}";
 }
        public static void Main(string[] args)
        {
            var cache = new DataCache();
            var rfp   = new RuleToFunctorParser(cache);

            rfp.CreateFunctors(AddFunctor);

            string folder = @".\";

            CheckForCommandLine(args, pathKeyword, ref folder);
            uint scale = 1;

            CheckForCommandLine(args, scaleKeyword, ref scale);
            CheckForCommandLine(args, supportedKeyword);
            CheckForCommandLine(args, helpKeyword);

            List <ActiveRuleValidity> rules = new List <ActiveRuleValidity>(100);

            for (int i = 0; i != args.Length; ++i)
            {
                if (args[i].ToLower() == rulesKeyword)
                {
                    for (int j = i + 1; j < args.Length - 1; j += 2)
                    {
                        string name  = args[j].ToLower();
                        var    ienum = _functors.Where(s => s.RuleName().ToLower() == name);
                        bool   found = ienum.Count() > 0;
                        if (!found)
                        {
                            break;
                        }

                        bool valid = false;
                        if (bool.TryParse(args[j + 1], out valid))
                        {
                            rules.Add(new ActiveRuleValidity()
                            {
                                RuleName = ienum.First().RuleName(),
                                Valid    = valid
                            });
                        }
                    }

                    break;
                }
            }

            if (rules.Count > 0)
            {
                XmlGenerator.CreateAllFiles(rfp, rules, UKPRN, folder, scale);
            }
            else
            {
                DisplayUsage();
            }
        }