示例#1
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);
    }