public static void AddGroup(DownLoadGroup pGroup) { if (!Instance.sGroupMap.ContainsKey(pGroup.Key)) { Instance.sGroupMap.Add(pGroup.Key, pGroup); } }
private void OnDestroy() { ArrayList tkeys = new ArrayList(sDownLoadMap.Keys); for (int i = 0, length = tkeys.Count; i < length; i++) { object tk = tkeys[i]; DownLoader item = (DownLoader)sDownLoadMap[tk]; item.Dispose(); } ArrayList tgkeys = new ArrayList(sGroupMap.Keys); for (int i = 0, length = tgkeys.Count; i < length; i++) { object tk = tgkeys[i]; DownLoadGroup item = (DownLoadGroup)sGroupMap[tk]; item.Dispose(); } }
void UpdateGroup() { if (sGroupMap.Count == 0) { return; } ArrayList tkeys = new ArrayList(sGroupMap.Keys); for (int i = 0, length = tkeys.Count; i < length; i++) { var tkey = tkeys[i]; DownLoadGroup item = (DownLoadGroup)sGroupMap[tkey]; item.Update(); if (item.IsDone) { RemoveGroup(tkey); item.CallComplete(); } } }