Exemple #1
0
        public static Definition GetInstance(DefinitionConfig configuration, FilterMap coreFilterMap, FilterMap pluginFilterMap)
        {
            var def = new Definition();

            if (configuration.Items.ContainsKey(CORESECTION))
                def._filters.AddRange(configuration.Items[CORESECTION].Select(item => new Filter(item.Key, item.Value, new List<IFilterResult>{coreFilterMap.Get(item.Key)})));

            if (configuration.Items.ContainsKey(PLUGINSECTION))
                def._filters.AddRange(configuration.Items[PLUGINSECTION].Select(item => new Filter(item.Key, item.Value, new List<IFilterResult>{pluginFilterMap.Get(item.Key)})));

            if (configuration.Items.ContainsKey(USERSECTION))
                def._filters.AddRange(configuration.Items[USERSECTION].Select(item => new Filter(item.Key, item.Value, new List<IFilterResult>{new EmptyResult()})));

            def.Version = configuration.GetValue("version", INFOSECTION);
            def.ModRequired = Convert.ToBoolean(configuration.GetValue("mod_required", INFOSECTION));
            def.Label = configuration.GetValue("label", INFOSECTION);
            def.FullName = string.Format("{0}{1}", !string.IsNullOrWhiteSpace(def.Label) ? def.Label + " " : "", def.Version);

            return def;
        }
Exemple #2
0
        public static Definition GetInstance(string definitionRegex)
        {
            var def = new Definition();

            def._filters.Add(new Filter("Definition", definitionRegex, new List<IFilterResult>{new EmptyResult()}));

            return def;
        }
Exemple #3
0
 public ResultNotifier(IServer server, Definition definition)
 {
     server.ErrorReceived += OnErrorReceived;
     server.OutputReceived += OnOutputReceived;
     _definition = definition;
 }