Exemplo n.º 1
0
        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);
                    }
                }
            }
        }
Exemplo n.º 2
0
        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);
                    }
                }
            }
        }
Exemplo n.º 3
0
        //private readonly ITagParser tagParser = null;

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