Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    public ThreadInfo DownloadAccountListFile(string url, string hostName, string jsonFile)
    {
        if (_AccoutRoleListResult.IsRunning)
        {
            return(_AccoutRoleListResult);
        }

        if (_DynamicServerThread == null)
        {
            _DynamicServerThread = new AssetUtility.SingleThreadWorker();
        }

        _AccoutRoleListResult.IsRunning = true;
        _DynamicServerThread.StartTask(() =>
        {
            string errMsg = string.Empty;
            _AccoutRoleListResult.ErrorCode = FetchAccountRoleListFile(url, hostName, jsonFile, DownloadMan.reqTimeOut, out errMsg);
            if (!string.IsNullOrEmpty(errMsg))
            {
                _AccoutRoleListResult.ErrMsg = errMsg;
            }
            _AccoutRoleListResult.IsRunning = false;
        });

        return(_AccoutRoleListResult);
    }
Ejemplo n.º 3
0
 public void OnUncompressToSepFileComplete()
 {
     if (!_UncompressToSepFileResult.IsRunning)
     {
         if (_UncompressToSepFileThread != null)
         {
             _UncompressToSepFileThread.Stop();
             _UncompressToSepFileThread.Abort();
             _UncompressToSepFileThread = null;
         }
     }
 }
Ejemplo n.º 4
0
 public void OnCalcMd5Complete()
 {
     if (!_CalcMd5Result.IsRunning)
     {
         if (_CalcMd5Thread != null)
         {
             _CalcMd5Thread.Stop();
             _CalcMd5Thread.Abort();
             _CalcMd5Thread = null;
         }
     }
 }
Ejemplo n.º 5
0
 public void OnExtractFileComplete()
 {
     if (!_ExtractPackResult.IsRunning)
     {
         if (_ExtractPackThread != null)
         {
             _ExtractPackThread.Stop();
             _ExtractPackThread.Abort();
             _ExtractPackThread = null;
         }
     }
 }
Ejemplo n.º 6
0
 public void OnDynamicDownloadComplete()
 {
     if (!_AccoutRoleListResult.IsRunning && !_ServerListResult.IsRunning)
     {
         if (_DynamicServerThread != null)
         {
             _DynamicServerThread.Stop();
             _DynamicServerThread.Abort();
             _DynamicServerThread = null;
         }
     }
 }
Ejemplo n.º 7
0
    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);
    }
Ejemplo n.º 8
0
    private CalcMd5ThreadInfo CalcMemMd5(IntPtr pData, int dataSize)
    {
        if (_CalcMd5Result.IsRunning)
        {
            return(_CalcMd5Result);
        }

        if (_CalcMd5Thread == null)
        {
            _CalcMd5Thread = new AssetUtility.SingleThreadWorker();
        }

        _CalcMd5Result.IsRunning = true;
        _CalcMd5Thread.StartTask(() =>
        {
            _CalcMd5Result.Md5       = FileOperate.CalcMemMd5(pData, dataSize);
            _CalcMd5Result.IsRunning = false;
        });

        return(_CalcMd5Result);
    }
Ejemplo n.º 9
0
    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);
    }