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); }
public static IList <T> GetAll() { return(Exports.Select(export => (T)Activator.CreateInstance(export)).ToList()); }
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()))); }