public static void LoadFormatters(FormatterCache cache)
        {
            if (cache == null)
                return;

            // load all formatters from this assembly
            Type[] types = Assembly.GetExecutingAssembly().GetTypes();
            foreach (Type type in types)
            {
                if (type.GetInterface("IFilter") != null && !type.IsAbstract)
                {
                    IFilter filter = Activator.CreateInstance(type) as IFilter;
                    if (filter != null)
                    {
                        cache.Add(filter);
                    }
                }
            }
        }
        public static void LoadFormatters(FormatterCache cache)
        {
            if (cache == null)
            {
                return;
            }

            // load all formatters from this assembly
            Type[] types = Assembly.GetExecutingAssembly().GetTypes();
            foreach (Type type in types)
            {
                if (type.GetInterface("IFilter") != null && !type.IsAbstract)
                {
                    IFilter filter = Activator.CreateInstance(type) as IFilter;
                    if (filter != null)
                    {
                        cache.Add(filter);
                    }
                }
            }
        }
Exemple #3
0
        //private readonly ITagParser tagParser = null;

        public FilterRunner()
        {
            formatterCache = new FormatterCache();
            FormatterCache.LoadFormatters(formatterCache);
        }
Exemple #4
0
 //private readonly ITagParser tagParser = null;
 public FilterRunner()
 {
     formatterCache = new FormatterCache();
     FormatterCache.LoadFormatters(formatterCache);
 }