Ejemplo n.º 1
0
        public static IPlugin CreateUsing(PluginParameter args)
        {
            var info = new FileInfo(args.Filename);
            if (info.Length == 0) return null;
            
            foreach (var plugin in Plugins.Where(plugin => plugin.IsSatisifedBy(args.Filename)))
            {
                return plugin.CreateUsing(args);
            }

            // default plugin if we can't recognize the others
            return new HexPlugin().CreateUsing(args);
        }
Ejemplo n.º 2
0
        public static IPlugin CreateUsing(PluginParameter args)
        {
            var info = new FileInfo(args.Filename);

            if (info.Length == 0)
            {
                return(null);
            }

            foreach (var plugin in Plugins.Where(plugin => plugin.IsSatisifedBy(args.Filename)))
            {
                return(plugin.CreateUsing(args));
            }

            // default plugin if we can't recognize the others
            return(new HexPlugin().CreateUsing(args));
        }