W
Wamiq Ansari
Hi!,
I am trying to add a value to a StringDictionary using its Item Property in
C#. However this throws an expection as follows:
Cannot implicitly convert type 'Component.TemplateComponent' to 'string'.
The method I am using is as follows:
private StringDictionary componentList = new StringDictionary();
public void addComponent(TemplateComponent docComponent)
{
componentList["AAA"] = docComponent;
}
Remember the main idea is to avoid using StringDictionary.Add() method and
use C# indexer property. The above example works if I use a Hashtable
instead of StringDictionary. Is there anything special about
StringDictionary that i'm missing.
Help!!!!
Wamiq
I am trying to add a value to a StringDictionary using its Item Property in
C#. However this throws an expection as follows:
Cannot implicitly convert type 'Component.TemplateComponent' to 'string'.
The method I am using is as follows:
private StringDictionary componentList = new StringDictionary();
public void addComponent(TemplateComponent docComponent)
{
componentList["AAA"] = docComponent;
}
Remember the main idea is to avoid using StringDictionary.Add() method and
use C# indexer property. The above example works if I use a Hashtable
instead of StringDictionary. Is there anything special about
StringDictionary that i'm missing.
Help!!!!
Wamiq