Sounds like you need a multi-dictionary. The free PowerCollections library on codeplex provides such a data structure.Quote:
Originally Posted by lsy
PowerCollections
MultiDictionary
Here's a usage example:
MultiDictionary Example
Printable View
Sounds like you need a multi-dictionary. The free PowerCollections library on codeplex provides such a data structure.Quote:
Originally Posted by lsy
PowerCollections
MultiDictionary
Here's a usage example:
MultiDictionary Example
So, a multidimensional array? ;oQuote:
Originally Posted by lsy
Sample using hashtableCode:private void Form1_Load_1(object sender, System.EventArgs e)
{
Hashtable h = new Hashtable();
h.Add(1, new Student("anis", "khan"));
h.Add(10, new Student("sami", "khan"));
Text = ((Student)h[10]).FirstName;
}
Code:private struct Student
{
private string m_FirstName;
private string m_LastName;
public Student(string firstName, string lastName)
{
m_FirstName = firstName;
m_LastName = lastName;
}
public object FirstName {
get { return m_FirstName; }
}
public object LastName {
get { return m_LastName; }
}
}