コード例 #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);
        }
コード例 #2
0
 public static IList <T> GetAll()
 {
     return(Exports.Select(export => (T)Activator.CreateInstance(export)).ToList());
 }
コード例 #3
0
ファイル: Runner.cs プロジェクト: Knight1988/SharpUtility
 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())));
 }