public void Del(ViAsynLoader loader) { foreach (ViAsynLoader iterLoader in _list) { if (iterLoader == loader) { loader.Detach(); _list.Remove(iterLoader); break; } } }
public static void ClearAll() { _list.BeginIterator(); while (!_list.IsEnd()) { ViRefNode2 <ViAsynLoader> node = _list.CurrentNode; ViAsynLoader loader = node.Data; ViDebuger.AssertError <ViAsynLoader>(loader, "ViAsynLoader.ClearAll() loader is null"); _list.Next(); loader.Detach(); } _list.Clear(); }
void OnLoaded(ViAsynLoader loader) { //ViDebuger.Note("ViAsynLoaderList.OnLoaded"); foreach (ViAsynLoader iterLoader in _list) { if (iterLoader.IsLoaded == false) { return; } } OnCompleted dele = _deleOnCompleted; _deleOnCompleted = null; if (dele != null) { dele(this); } }
//+------------------------------------------------------------------------------------------------------------------------------------------------------------- public static void UpdateAll() { _list.BeginIterator(); while (!_list.IsEnd()) { ViRefNode2 <ViAsynLoader> node = _list.CurrentNode; ViAsynLoader loader = node.Data; ViDebuger.AssertError <ViAsynLoader>(loader, "ViAsynLoader.UpdateAll() loader is null"); _list.Next(); loader.TryLoad(); if (loader.IsLoaded) { OnCompleted dele = loader.DeleOnCompleted; loader.Detach(); loader.OnLoaded(); if (dele != null) { dele(loader); } } } }
public void Add(ViAsynLoader loader) { _list.Add(loader); loader.Attach(this.OnLoaded); }