public AbiTool GetTool(string toolName) { //reads manifest.xml ManifestEntry manifestEntry = this.manifest.getEntry(toolName); //fetches tool if needed if (!this.DownloadTool(manifestEntry)) { //error } //returns tool object return(CreateTool(toolName, manifestEntry)); }
public AbiTool CreateTool(string toolName, ManifestEntry manifestEntry) { AbiTool result = null; switch (toolName) { //gonna be a huge nasty switch block, Activator would make this simpler but reflection can make heads blow up case "SignFile": //make the generic SignFile result = new SignFile(this.GetToolPath(manifestEntry)); break; case "SignTool": //make the generic SignFile result = new SignTool(this.GetToolPath(manifestEntry)); break; default: throw new Exception("Unsupported tool name!"); } return(result); }
public string GetToolPath(ManifestEntry manifestEntry) { return("path to tool exe"); }
public bool DownloadTool(ManifestEntry manifestEntry) { //use wit to download the tool return(true); }