private void StartDownLoad(GameResFileInfo resInfo)
    {
        if (IsLoading)
        {
            return;
        }
        IsLoading   = true;
        IsDone      = false;
        Progress    = 0;
        gameResInfo = resInfo;

        string localfolderPath = URLFactory.GetLocalGameResSaveFolder(resInfo.gameName);
        string tagfolderPath   = URLFactory.GetLocalGameTagFolder(resInfo.gameName);

        if (!Directory.Exists(localfolderPath))
        {
            Directory.CreateDirectory(localfolderPath);
        }
        if (!Directory.Exists(tagfolderPath))
        {
            Directory.CreateDirectory(tagfolderPath);
        }

        TotalBytesKB = 0;
        foreach (DownLoadFileInfo info in resInfo.infoList)
        {
            if (DownLoadManager.CheckOnceFileInfo(info) != GameVersionState.NewestVersion)
            {
                DownLoadThread downLoadThread = new DownLoadThread();
                downLoadThreadList.Add(downLoadThread);
                downLoadThread.StartDownLoad(info);
                TotalBytesKB += info.size;
            }
        }
    }
Beispiel #2
0
        private void DownloadAndAutoExchangeOnStripMenuItem_Click(object sender, EventArgs e)
        {
            VisibleMenuItem(false);
            if (GlobalVars.CurrentSettingsBase.Settings.Exchange_launched)
            {
                return;
            }

            DownLoadThreadMT                  = new DownLoadThread();
            DownLoadThreadMT.ThreadName       = "DownLoadThreadMT";
            DownLoadThreadMT.SettingsBase     = GlobalVars.CurrentSettingsBase;
            DownLoadThreadMT.Mode             = 11;
            DownLoadThreadMT.ClosingThread   += ClosingThreadDelegate;
            DownLoadThreadMT.AddLog          += AddLogEvent;
            DownLoadThreadMT.EditDGV         += EditDGVEvent;
            DownLoadThreadMT.EditTabPageText += EditTabPageTextEvent;
            DownLoadThreadMT.Start();
        }