示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
 public string GetToolPath(ManifestEntry manifestEntry)
 {
     return("path to tool exe");
 }
示例#4
0
 public bool DownloadTool(ManifestEntry manifestEntry)
 {
     //use wit to download the tool
     return(true);
 }