Exemplo n.º 1
0
        private void SingleLoaded(HttpLoad loader)
        {
            if (!string.IsNullOrEmpty(loader.Error))
            {
                loader.Close(); // 下载失败则关闭
                Error = Error + "\n" + loader.Error;
            }
            OnSingleLoaded?.Invoke(loader);

            if (LoadIndex == LoadNum)
            {
                IsDone = true;
            }
            if (IsDone)
            {
                OnAllLoaded?.Invoke(this);
            }
        }
Exemplo n.º 2
0
 private void AllLoading(WebLoader loader)
 {
     SingleProgress = loader.Progress;
     mTotalProgress = LoadIndex + SingleProgress;
     FinalProgress  = mTotalProgress / LoadNum;
     if (loader.IsDone)
     {
         LoadIndex = LoadIndex + 1;
     }
     if (LoadIndex == LoadNum)
     {
         IsDone = true;
     }
     OnAllLoading?.Invoke(this);
     if (IsDone)
     {
         OnAllLoaded?.Invoke(this);
     }
 }