示例#1
0
 public void Clear()
 {
     if (_nodes == null)
     {
         return;
     }
     for (int i = 0, iN = _nodes.Count; i < iN; i++)
     {
         _nodes[i].parent = null;
         _nodes[i].index  = -1;
     }
     _nodes.Clear();
 }
示例#2
0
        void DiscardOld(System.DateTime referenceTime)
        {
            System.DateTime dthresh = referenceTime - TIMEOUT;
            if (this.oldestInfoTime > dthresh)
            {
                return;
            }

            lock (sync_root){
                System.DateTime oldest = System.DateTime.MaxValue;

                Gen::List <string> remove_key = new Gen::List <string>();
                foreach (Gen::KeyValuePair <string, FileInfo> pair in this.dicattr)
                {
                    System.DateTime infotime = pair.Value.informationTime;
                    if (infotime < dthresh)
                    {
                        remove_key.Add(pair.Key);
                    }
                    else if (infotime < oldest)
                    {
                        oldest = infotime;
                    }
                }
                foreach (string k in remove_key)
                {
                    this.dicattr.Remove(k);
                }

                remove_key.Clear();
                foreach (Gen::KeyValuePair <string, DirEntries> pair in this.diclist)
                {
                    System.DateTime infotime = pair.Value.informationTime;
                    if (infotime < dthresh)
                    {
                        remove_key.Add(pair.Key);
                    }
                    else if (infotime < oldest)
                    {
                        oldest = infotime;
                    }
                }
                foreach (string k in remove_key)
                {
                    this.diclist.Remove(k);
                }

                this.oldestInfoTime = oldest;
            }
        }
示例#3
0
 public void Clear()
 {
     if (_nodes == null)
     {
         return;
     }
     if (this.isreadonly)
     {
         throw new System.NotSupportedException("This collection is readonly.");
     }
     for (int i = 0, iN = _nodes.Count; i < iN; i++)
     {
         _nodes[i].parent = null;
         _nodes[i].index  = -1;
     }
     _nodes.Clear();
 }
示例#4
0
 public void Clear()
 {
     lock (list){
         for (int i = list.Count - 1; i >= 0; i--)
         {
             try{
                 System.IDisposable disp = list[i];
                 if (disp != null)
                 {
                     disp.Dispose();
                 }
             }catch (System.Exception e0) {
                 msg.ReportErr(e0);
             }
         }
         list.Clear();
     }
 }
示例#5
0
        //--------------------------------------------------------------------------
        private void DiscardOld()
        {
            System.DateTime dthresh = System.DateTime.Now - TIMEOUT;
            if (this.dt_discard > dthresh)
            {
                return;
            }

            lock (sync_root){
                Gen::List <string> remove_key = new Gen::List <string>();
                foreach (Gen::KeyValuePair <string, SftpFileInfo> pair in this.dicattr)
                {
                    if (pair.Value.infodate < dthresh)
                    {
                        remove_key.Add(pair.Key);
                    }
                }
                foreach (string k in remove_key)
                {
                    this.dicattr.Remove(k);
                }

                remove_key.Clear();
                foreach (Gen::KeyValuePair <string, lsres_t> pair in this.diclist)
                {
                    if (pair.Value.date < dthresh)
                    {
                        remove_key.Add(pair.Key);
                    }
                }
                foreach (string k in remove_key)
                {
                    this.diclist.Remove(k);
                }
            }
        }