Пример #1
0
 internal static void ClearAttachments(object parent)
 {
     lock (Attachments)
     {
         Attachments.Remove(parent);
     }
 }
Пример #2
0
 public void RemoveUser(string UserId)
 {
     if (!string.IsNullOrEmpty(UserId))
     {
         _list.Remove(UserId, out _);
     }
 }
Пример #3
0
 public void SetAttachment(string name, object attach)
 {
     lock (Attachments)
     {
         if (name == null)
         {
             Attachments.Clear();
         }
         else if (attach == null)
         {
             Attachments.Remove(name);
         }
         else
         {
             Attachments[name] = attach;
         }
     }
 }
Пример #4
0
        public void CleanupListeners()
        {
            LinkedList <string> keysToRemove = null;

            foreach (var g in listeners)
            {
                g.Value.RemoveAll(x => !x.IsValid);
                if (g.Value.Count == 0)
                {
                    if (keysToRemove == null)
                    {
                        keysToRemove = new LinkedList <string>();
                    }
                    keysToRemove.AddLast(g.Key);
                }
            }
            if (keysToRemove != null)
            {
                foreach (var k in keysToRemove)
                {
                    listeners.Remove(k, out _);
                }
            }
        }
Пример #5
0
 public void RemoveDevice(object key)
 {
     devices.Remove(key.ToString(), out var value);
 }
Пример #6
0
 public void Delete(byte[] key)
 {
     System.Numerics.BigInteger nkey = new System.Numerics.BigInteger(key);
     this.wb.Delete(key);
     cache.Remove(nkey, out byte[] v);
 }