Esempio n. 1
0
        public string GetMaxVersion()
        {
            if (!Exports.Any())
            {
                return(CurrentVersion);
            }

            long numeric = 0;

            string version = "0.0.0.0";

            foreach (string ver in Exports.Select(e => e.Version))
            {
                long current = convertToLong(ver);

                if (current > numeric)
                {
                    numeric = current;

                    version = ver;
                }
            }

            return(version);
        }
Esempio n. 2
0
 public static IList <T> GetAll()
 {
     return(Exports.Select(export => (T)Activator.CreateInstance(export)).ToList());
 }
Esempio n. 3
0
 public string DoSomething()
 {
     // Here you can access Exports which contain Dictionary of plugin class
     // Tell our MEF parts to do something.
     return(string.Join(" ", Exports.Select(p => p.Value.InHere())));
 }