Exemple #1
0
 public void Add(Link link)
 {
     lock (creatorToOther)
     {
         creatorToOther.GetOrAdd(link.Creator).Add(link.Other);
         otherToCreator.GetOrAdd(link.Other).Add(link.Creator);
     }
 }
Exemple #2
0
        public void Remove(Link link)
        {
            lock (creatorToOther)
            {
                List<ActorId> a;
                foreach (var alias in DnsAlias.Get(link.Creator))
                    if (creatorToOther.TryGetValue(alias, out a))
                    {
                        a.Remove(alias);
                        if (!a.Any())
                            creatorToOther.Remove(alias);
                    }
                foreach(var alias in DnsAlias.Get(link.Other))
                    if (otherToCreator.TryGetValue(alias, out a))
                    {
                        a.Remove(alias);
                        if (!a.Any())
                            otherToCreator.Remove(alias);
                    }

            }
        }