Article View: borland.public.csharpbuilder.language.csharp
Article #89Re: Indexed properties
From: Joanna Carter [TeamB]
Date: Sat, 01 Apr 2006 08:53
Date: Sat, 01 Apr 2006 08:53
33 lines
1628 bytes
1628 bytes
"Nils Haeck" <bla@bla.com> a οΏ½crit dans le message de news:
442dc6a5$1@newsgroups.borland.com...
| I'm looking to transcode some of my components to C#.
|
| In Delphi I love using indexed properties. However it seems that in C#
there
| can only be one indexed property per class, is this correct?
You can have more than one indexer, as long as the parameters are of
distinct types :
public class Thing
{
public object this[string index]
{
....
}
public object this[int index]
{
....
}
}
Note that you cannot distinguish indexers solely on the type of the
"property" though.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
Technical Details
Message-ID:
<442e3f8a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<442dc6a5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,8168306bbf9f2550 X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII From: "Joanna Carter [TeamB]" <joanna@not.for.spam> Newsgroups: borland.public.csharpbuilder.language.csharp References: <442dc6a5$1@newsgroups.borland.com> Subject: Re: Indexed properties Date: Sat, 1 Apr 2006 09:53:25 +0100 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 82.69.239.102 Message-ID: <442e3f8a$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1143881610 82.69.239.102 (1 Apr 2006 00:53:30 -0700) X-Authenticated-User: jcarter Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail