Esempio n. 1
0
        public TKepwareServer ByAddress(string addr)
        {
            TKepwareServer rlt = null;

            idxByAddress.TryGetValue(addr, out rlt);
            return(rlt);
        }
Esempio n. 2
0
        public int Remove(TKepwareServer item)
        {
            bool successed = false;

            do
            {
                successed = items.Remove(item);
                successed = idxByAddress.Remove(item.Address);
            } while (successed);

            return(items.Count);
        }
Esempio n. 3
0
        public int Add(TKepwareServer item)
        {
            if (item != null)
            {
                TKepwareServer oldServ = ByAddress(item.Address);
                if (oldServ != null)
                {
                    Remove(oldServ);
                }

                items.Add(item);
                idxByAddress.Add(item.Address, item);
            }

            return(items.Count);
        }