blah blah blah is here! blah blah » Close

0
votes
1 answers

Help adding an item to a Dictionary of KeyValuePairs<string,object) using a object initializer

Rick_A
761

I have a dictionary, and I want to know how to add an item to the collection using which I believe is called 'object initializer'. So my collection is SomeDictionary. [code]SomeDictionary.Add(new KeyValuePair<string,object>() ?? ...

1
votes
2 answers

Creating a triple-string dictionary class

Hi, I'm not a fan of making databases but this project requires that I make one. While there are multiple solutions I could use, the easiest method I devised would be using a dictionary with two keys and one value, such as: Dictionary<st ...

1
votes
1 answers

Collection was modified; enumeration operation may not execute.

Rick_A
761

I am looping through the items in my Dictionary, and I get this error when I try and modify the value of the key. [code]Dictionary<string,string> dic = new Dictionary<string,string>(); dic = LoadFromSomething(); forea ...

1
votes
1 answers

Help designing a name/value pair metaproperty collection that I will use in all my entity objects

Rick_A
761

I want to create a 'MetaProperties' property on all my entity classes. So I would have a BaseEntity abstract class that all my other entities would inherit from. At the database level, I will have a NVARCHAR(MAX) column. I want to ...

1
votes
1 answers

How can I sort a Dictionary<int, User> collection by a property in the class

I have a collection of type: [code]Dictionary<int, User>[/code] And I want to sort by alphabetically ordering by the 'Name' property of the User object. How can I do this?

0
votes
2 answers

How to sort this?

AK01
15

Hi! A have an associative massive... something like "green" => 5 "red" => 3 "yellow" => 1 "brown" => 4 "orange" => 2 I need to sort it by the second value, i.e.: ...

1
votes
2 answers

Dictionary ContainsKey

foamy
2499

Hi all, Say I have a Dictionary<Task, DateTime> where Task is a class I made. Task overrides Equals like this: [code] public override bool Equals(object obj) { if (obj == null || !(obj is Task)) return false; ...

1
votes
1 answers

More Binding Questions

eeboy
499

I am now attempting to bind a dictionary to a combobox. I have a class called camera which loads an xml file into a dictionary. [code] class Camera { public Dictionary<int, Mode> Modes = new Dictionary<int, ...

Feedback