public static void GenerateLibAsync(string origFile, Action <PatchException> callback)
 {
     new Thread(() => {
         PatchException exception = null;
         try
         {
             GenerateLib(origFile);
         }
         catch (PatchException e)
         {
             exception = e;
         }
         finally
         {
             callback(exception);
         }
     }).Start();
 }
 //TODO setup progress callback
 public static void PatchAsync(string origFile, string patchFile, Action <AssemblyDefinition, PatchException> callback)
 {
     new Thread(() => {
         PatchException exception  = null;
         AssemblyDefinition asmDef = null;
         try
         {
             Patch(origFile, patchFile, out asmDef);
         }catch (PatchException e)
         {
             exception = e;
         }
         finally
         {
             callback(asmDef, exception);
         }
     }).Start();
 }