public void LoadApplications(Action <HmeServer> serverAction, params string[] applicationDirectories) { string[] results = AddInStore.Rebuild(PipelineStoreLocation.ApplicationBase); string[] addinResults = AddInStore.RebuildAddIns(applicationDirectories[0]); var addInTokens = AddInStore.FindAddIns(typeof(IHmeApplicationDriver), PipelineStoreLocation.ApplicationBase,//); applicationDirectories); foreach (AddInToken token in addInTokens) { IHmeApplicationDriver driver = token.Activate <IHmeApplicationDriver>(AddInSecurityLevel.Host); Uri assemblyCodeBase = new Uri(driver.GetType().Assembly.GetName().CodeBase); System.IO.FileInfo assemblyFileInfo = new System.IO.FileInfo(assemblyCodeBase.LocalPath); foreach (var identity in driver.ApplicationIdentities) { HmeServer server = new HmeServer(identity, driver); if (serverAction != null) { serverAction(server); } Add(server, identity, assemblyFileInfo.DirectoryName); } } }
public void Add(HmeServer server, IHmeApplicationIdentity identity, string path) { _servers.Add(new HmeServerAndData { HmeServer = server, Identity = identity, ServerPath = path }); }