static void Thread_LoadCommandList(CommandListResult result) { try { result.Commands = LoadCommandList(); } catch (Exception ex) { result.Exception = ex; } }
public static void LoadCommandListAsync(Action <CommandListResult> callback) { var result = new CommandListResult(); Async.DoWork(() => Thread_LoadCommandList(result), () => callback(result)); }