Sure, but you need to adjust your code.
Here is what you need:
1) A property called Properties which points to something like a Hashtable
or dictionary.
2) A structure that holds all the properties such as Value.
3) The Hashtable would then contain references to the structure.
Keep in mind what your code is doing. First it needs to dereference the
Properties property. Next it sees the indexer so what gets returned from
Properties must have an indexer (like a collection or hashtable). Finally,
the item found in the collection must have a Value property.
"Julia" <co********@012.net.il> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi
I have class named Property:
enum PropertyType
{
text,
numeric
}
class Property
{
string stringValue;
long numericValue;
PropertyType type;
}
and a collection of properties,in the example the collection hold two
properties
a Url which is string type,and Size which is long type
I would like to be able to do something like the following
string Value1=Properties["Url"].value //this should return a string type
value
long Value2=Properties["Size"].value //this should return a long type
value
can't it be done?
thanks.