[prev in list] [next in list] [prev in thread] [next in thread]
List: mono-list
Subject: Re: [Mono-list] StringDictionary Class
From: Marcus <mathpup () mylinuxisp ! com>
Date: 2004-11-26 5:05:21
Message-ID: 200411252305.21384.mathpup () mylinuxisp ! com
[Download RAW message or body]
Short version: The Item property is really an indexer, which permits
array-like access to the data structure. For example, code fragment below
should print ``Apple'':
StringDictionary dict = new StringDictionary();
dict.Add("a", "Apple");
Console.WriteLine(dict["a"]);
Longer version: This is one of the cases where the C# representation differs
from that of the underlying metadata. From C#'s perspective, properties do
not have parameters, and they only have code associated with "getting" and
"setting." The metadata that the CLI seems actually permits properties with
zero or many parameters, even though C# does not directly support declaring
them. In the case of StringDictionary, there is a property names Item, which
takes a parameter. From C#'s perspective, this is an indexer.
On Thursday 25 November 2004 10:33 pm, Ryan wrote:
> I'm trying to use the System.Collections.Specialized.StringDictionary
> class but when I try to use
> the Item property it say it doesn't contain a definition for it. The
> documentation doesn't mark it as incomplete though. The same goes for
> ListDictionary.Item
>
> Are these incomplete or and I doing something wrong? I know I'm not
> mistyping it.
_______________________________________________
Mono-list maillist - Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic