Questions tagged [idictionary]

System.Collections.IDictionary and System.Collections.Generic.IDictionary interfaces in the BCL (Base Class Library) of the .NET framework represent a collection of key-value pairs.

System.Collections.IDictionary and System.Collections.Generic.IDictionary<TKey, TValue>interfaces in the BCL (Base Class Library) of the .NET framework represent a collection of key-value pairs.

MSDN links:

148 questions
0
votes
2 answers

= IDictionary

I have 3 entities: class User {id,name...} class UserUrl {id,user_id,url,url_type_id} class UrlType {id,name} My mapping:        
Kate
0
votes
2 answers

Ensuring unique keys in Exception.Data IDictionary

I have written an extension method to help with collecting crash data during error reporting. This method is designed to ensure that a key is always unique. If you have a few try/catch blocks, sometimes data can get duplicated. I'm going for…
Mark Williams
  • 583
  • 7
  • 18
0
votes
2 answers

How to add IDictionary extension method for Exception.Data

I'd like to create an extension method to the IDictionary collection Exception.Data that allows me to add an item to the dictionary without having to ensure the key is unique. I can't get the extension method to show up. public static void…
Mark Williams
  • 583
  • 7
  • 18
0
votes
2 answers

IDictionary, Dictionary

I have: IDictionary>> OldDic1; (just for illustration purposes, it is instantiated and has values - somewhere else) Why can I do this: ? Dictionary>> dic1 = OldDic1…
ra170
  • 3,643
  • 7
  • 38
  • 52
-1
votes
1 answer

NullReferenceException When Assigning Key Value Pair in Unity

I am trying to develop a stat assignment system in Unity3D using the UI functions, but I am running into a issue where when I attempt to assign a Key Value pair to an IDictionary the Unity Console throws the following error NullReferenceException:…
Sage Hopkins
  • 183
  • 1
  • 3
  • 15
-1
votes
1 answer

INotifyPropertyChanged does not update listbox in Windows Forms

I am trying to update a Listbox whenever a new 'key','value' is added to a dictionary. I have a class that implements IDictionary and INotifyPropertyChanged ( copied from MSDN) and it has a method Add. (I have not added other methods to keep the…
-1
votes
5 answers

SortedDictionary - cant proceed if node is null

So, my code stop running when a node is null, but i . Node node = nodeMap[x]; (BREAKS HERE case x isn't in the tree yet) if(node == null) { node = new Node(); node.Equals(x); …
-1
votes
1 answer

IDictionary interface without Remove()

Is there an IDictionary interface which does not support removal of Key-Value pairs? Unfortunately, IReadOnlyDictionary does not help as it does not allow to modify the Key-Value pairs. If not, what's a good way to implement one myself? Is this even…
D.R.
  • 20,268
  • 21
  • 102
  • 205
-2
votes
1 answer

I have iDictionary and would like to update value of a key/value pair (pass by reference) c#

I have a concurrent dictionary and would like to update an object property (e.g. an employee age) by another method: For example (pseudo code) class Employee { string name; int age; } main() { //Sample dic => iDictionary("John",…
Ben
  • 17
  • 2
-2
votes
1 answer

What is the modern analogue for a two-dimensional string array?

I'm refactoring some legacy code that uses a 2D string array: /// Array of valid server messages private static string[,] serverRsp = { {"JOIN", "RSP" }, {"SETTING", "RSP" }, . . . I want to modernize…
-3
votes
1 answer

How to find a specific value in an IDictionary?

This IDictionary contains user data I'm logging into mongodb. The issue is the TValue is a complex object. The TKey is simply the class name. For example: public class UserData { public string FirstName { get; set; } public…
koshi
  • 311
  • 3
  • 8
-3
votes
2 answers

Getting rid of whitespace in a dictionary

I have a dictionary Dictionary> dictGenSubs = new Dictionary>(); How can I make sure that there is no whitespace in any of the records of the dictionary?
Arianule
  • 8,811
  • 45
  • 116
  • 174
-4
votes
3 answers

Check if Dictionary has continuous elements (DateTime)

I have the following Dictionary: bool hasContinuousDays = false; var selectedDates = new Dictionary(); selectedDates.Add("2014-06-21", DateTime.Now.ToString()); selectedDates.Add("2014-06-22",…
VAAA
  • 14,531
  • 28
  • 130
  • 253
1 2 3
9
10