Please explain why dictionary’s ‘getAt’ method fails
List<BString> infoKeys = new List<BString>(infoDict.Keys);
if (infoKeys.Contains(TorrentFileKeyWords.FILES_KEY) == true) //"files"
{
List<BaseType> multiFiles = ((BList)dict[TorrentFileKeyWords.FILES_KEY]).Value; <<< this fails
So infoDict is a Dictionary<String, BString>
Contains on infoDict.Keys is used to find a specific item (of type BString)
But line 4 fails… doesnt have sens
I am not used with c#.. so what methods do I have to override (now i have: GetHashCode, ==, != & equals)
I suspect the problem is that you’re using
infoDictin one place, anddictin another…It’s not clear why you’re creating a list from the keys of
infoDictrather than just callingContainsKey, or (better) usingTryGetValueto start with. Additionally, I would advise against a “B” prefix for your type names.