コード例 #1
0
 public void Dispose()
 {
     _transferInfo = null;
     if (_downloadList != null)
     {
         _downloadList.Clear();
         _downloadList = null;
     }
     if (_downloadFileInfoDict != null)
     {
         _downloadFileInfoDict.Clear();
         _downloadFileInfoDict = null;
     }
 }
コード例 #2
0
        public void ReadTransferProgress()
        {
            lock (_locker)
            {
                if (File.Exists(_transferInfoFilePath))
                {
                    string json = File.ReadAllText(_transferInfoFilePath);
                    _transferInfo = JsonUtility.FromJson <BreakpointTransferInfo>(json);
                    if (_transferInfo == null)
                    {
                        CLogger.LogError("解析本地断点续传记录json文件失败,json string=" + json);
                    }
                }

                if (_transferInfo == null)
                {
                    _transferInfo = new BreakpointTransferInfo();
                }
            }
        }