void OnFileDown(string url, bool isComplate) { LoadedInfo loadedInfo = new LoadedInfo { url = url, isError = isComplate }; queue.Add(loadedInfo); if (downloadings.Count == 0 && loadQueue.Count == 0) { isAllDone = true; } }
void OnFileDown(string url, bool isComplate) { string key = CUtils.GetUDKey("", url); downloadings.Remove(key); LoadedInfo loadedInfo = new LoadedInfo { url = url, isError = isComplate }; queue.Add(loadedInfo); if (waiting.Count > 0) { var e = waiting.GetEnumerator(); e.MoveNext(); var pfn = e.Current.Key; var pinfo = e.Current.Value; waiting.Remove(pfn); if (downloadings.ContainsKey(pfn)) downloadings[pfn] = pinfo; else downloadings.Add(pfn, pinfo); BeginLoad(pinfo); } else if (downloadings.Count == 0) { isAllDone = true; } }