public ThreadInfo DownloadServerListFile(string url, string hostName, string jsonFile) { if (_ServerListResult.IsRunning) { return(_ServerListResult); } if (_DynamicServerThread == null) { _DynamicServerThread = new AssetUtility.SingleThreadWorker(); } _ServerListResult.IsRunning = true; _DynamicServerThread.StartTask(() => { string errMsg = string.Empty; _ServerListResult.ErrorCode = FetchServerListFile(url, hostName, jsonFile, DownloadMan.reqTimeOut, out errMsg); if (!string.IsNullOrEmpty(errMsg)) { _ServerListResult.ErrMsg = errMsg; } _ServerListResult.IsRunning = false; }); return(_ServerListResult); }
private ExtractPackThreadInfo ExtractFileFrom7zReader(SevenZReader reader, int iFile) { if (_ExtractPackResult.IsRunning) { return(_ExtractPackResult); } if (reader == null) { _ExtractPackResult.Pointer = IntPtr.Zero; _ExtractPackResult.IsRunning = false; return(_ExtractPackResult); } if (_ExtractPackThread == null) { _ExtractPackThread = new AssetUtility.SingleThreadWorker(); } _ExtractPackResult.IsRunning = true; _ExtractPackThread.StartTask(() => { _ExtractPackResult.Pointer = reader.ExtractFile(iFile, out _ExtractPackResult.DataSize); _ExtractPackResult.IsRunning = false; }); return(_ExtractPackResult); }
private CalcMd5ThreadInfo CalcFileMd5(string fileName) { if (_CalcMd5Result.IsRunning) { return(_CalcMd5Result); } if (_CalcMd5Thread == null) { _CalcMd5Thread = new AssetUtility.SingleThreadWorker(); } _CalcMd5Result.IsRunning = true; _CalcMd5Thread.StartTask(() => { _CalcMd5Result.Md5 = FileOperate.CalcFileMd5(fileName); _CalcMd5Result.IsRunning = false; }); return(_CalcMd5Result); }
private UncompressToSepFileThreadInfo UncompressToSepFile(string filename, IntPtr pData, int dataSize) { if (_UncompressToSepFileResult.IsRunning) { return(_UncompressToSepFileResult); } if (_UncompressToSepFileThread == null) { _UncompressToSepFileThread = new AssetUtility.SingleThreadWorker(); } _UncompressToSepFileResult.IsRunning = true; _UncompressToSepFileThread.StartTask(() => { _UncompressToSepFileResult.RetFlag = PackFunc.UncompressToSepFile(filename, pData, dataSize); _UncompressToSepFileResult.IsRunning = false; }); return(_UncompressToSepFileResult); }