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
1 answer

How to map a dynamic type to a dictionary for a JSON

I want to take a JSON string and map it to a dictionary so I can have access to its key-value pairs and then check the values after. I keep getting an error: Unable to cast object of type Newtonsoft.Json.Linq.JObject to type…
0
votes
2 answers

IDictionary extension not actually running while in LInq Query .Where()

I have an extension for an IDictionary that is meant to allow it to be case insensitive when doing a contains: public static bool ContainsKeyIgnoreCase(this IDictionary dictionary, TKey key) { bool? keyExists; …
Maxxxxxy
  • 11
  • 2
0
votes
1 answer

How can i make any element first of Idictionary object in C# by key?

I have object type of IDictionary and i want to custom sort of object items e.g IDictionary animalObjects = new Dictionary() animalObjects = { …
0
votes
4 answers

How do I get a delegate returned from a iDictionary?

I am trying to use a dictionary to reference a delegate but I get an error when I try and retrieve the delegate pointer. For more context I am being given a string to use to lookup a value in C structure. I have written methods to get/set data in…
0
votes
1 answer

Wrapping multiple Lists in IDictionary

I have a class ObjectBatch as follows: [Serializable] class ObjectBatch : IDictionary { List> ModelATypes; List> ModelBTypes; List
IAbstract
  • 19,551
  • 15
  • 98
  • 146
0
votes
1 answer

Error when calling the service in async mode

Stackoverflow is definetly the fastest forum so after posting this question in the WCF forum I decided to come here. I have a wcf service which returns a dictionary (IDictionary) and that works just fine. Now I wanted to add the capability of…
sebagomez
  • 9,501
  • 7
  • 51
  • 89
0
votes
1 answer

How to convert IEnumerable> to IReadOnlyDictionary>>?

Let's say I've a class Telemetry as follows: public class Telemetry { public string Id { get; set; } public AdditionalInfo Info { get; set; } } Let's say I've a class: TelemetryCollection that implements : IEnumerable> I…
Manikanta
  • 73
  • 6
0
votes
0 answers

Bind IDictionary on datagrid control in WPF

i would like bind idictionary on datagrid view. Here is property which I bind on datagrid control. public IDictionary CellPhoneBills { get { return _cellPhoneBills; } set { _cellPhoneBills =…
totoz
  • 1
  • 1
0
votes
1 answer

Serializing dictionary in XNA 4.0

I want to serialize a tree in XNA 4.0, where each node has the children node in a member dictionary indexed by int as such: [Serializable] public class Node { private Dictionary children; } My intention is that when I serialize a…
JaimeBarrachina
  • 430
  • 8
  • 21
0
votes
1 answer

IDictionary Value overwrite

This is my first time when I need to do something with dictionaries. I can't overwrite the item.Value and i don't know how should I do that. Write a program that reads the name of one monkey per line from the lines of standard input to the end of…
vantsa
  • 13
  • 3
0
votes
1 answer

Access to the list items of IDictionary in RazorPage

I need to list all ceremonies incase of my searchModel parameters are empty. So When the page loaded, we should have a list of multimedia albums of ceremonies. The following method doing generate this list. but I need to show items of my…
Amin
  • 13
  • 5
0
votes
1 answer

IDictionary Custom Collection

Can anyone look at this and tell me what I'm doing wrong? I am having issue implementing the GetEnumerator methods, I have figured out a way to have the IDE create all of the methods so I can learn how to override them. Can anyone help complete…
0
votes
1 answer

How to work with an Interface that inherits IDictionary and set desrialize object return type as that interface

Here I have one interface which inherits IDictionary and what I want is to get return type of that interface Interface class using System.Collections.Generic; public interface IClientSettings : IDictionary { } Code part of…
J_Shrestha
  • 37
  • 1
  • 9
0
votes
1 answer

getting a IDictionary item value setter through reflection

I'm trying to get the setter function of a dictionary item value. I know the object is a Dictionary< TKey,TValue>, but I don't know the types of Tkey and TValue, so I think my only resort is to use an IDictionary. In pseudo code, I want to do…
Noktai
  • 71
  • 6
0
votes
4 answers

How to correctly display a pair

So, I was running through a C# online course in a class introducing IDictionary where they did this (for testing pairs that contain a string and an instance of a class): public static void Main(string[] args) { IDictionary
alfablac
  • 55
  • 6