コード例 #1
0
        private void RemoveMapItem()
        {
            // take the data from list to remove it without having enumeration problems (ToList)
            try
            {
                IEnumerable <KeyValuePair <long, MapItem> > dropsToRemove = DroppedList.Where(dl => dl.Value.CreateDate.AddMinutes(3) < DateTime.Now).ToList();

                foreach (KeyValuePair <long, MapItem> drop in dropsToRemove)
                {
                    Broadcast(drop.Value.GenerateOut(drop.Key));
                    MapItem mapItem;
                    DroppedList.TryRemove(drop.Key, out mapItem);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }