我对并发词典及其所有涉及“尝试”的新方法都很陌生。我在下面编写了一个简单的方法,从字典中检索roomInformation (roomInformation是一个类),然后打印它,如果它存在,并返回true。public bool TryGetRoomInformation(int roomId, out RoomInformation roomInformation) if (!_roomInformation.ContainsKey(roomId))
我正尝试在我的单点触控应用中使用ConcurrentDictionary。在我正尝试在我的单点触控应用中使用ConcurrentDictionary时,一切运行正常。at System.Collections.Concurrent.ConcurrentDictionary`2[System.String,System.Object]..ctor (IEqualityComparer`1 comparer) [0x00000] in <filename unknown>:0
at System.Collections.Conc