示例#1
0
 public void Del(ViAsynLoader loader)
 {
     foreach (ViAsynLoader iterLoader in _list)
     {
         if (iterLoader == loader)
         {
             loader.Detach();
             _list.Remove(iterLoader);
             break;
         }
     }
 }
示例#2
0
 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();
 }
示例#3
0
    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);
        }
    }
示例#4
0
 //+-------------------------------------------------------------------------------------------------------------------------------------------------------------
 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);
             }
         }
     }
 }
示例#5
0
 public void Add(ViAsynLoader loader)
 {
     _list.Add(loader);
     loader.Attach(this.OnLoaded);
 }