Re: Do we have extention properties in C# 3.0?
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Wed, 23 Jul 2008 20:59:45 -0400
Peter Duniho wrote:
On Wed, 23 Jul 2008 17:11:48 -0700, Arne Vajhøj <arne@xxxxxxxxxx> wrote:How should the syntax be to distinguish between
a method with no arguments and a property ?
Syntax for an extension property:
public int MyProperty(this SomeClass arg0)
{
get;
set;
}
Just because properties as declared now don't include an argument list, that doesn't mean they couldn't. There's enough other information in the declaration block to distinguish a property from a method, I believe.
No doubt there are other valid ways to allow the declaration of an extension property, but the above seems most straightforward and consistent to me.
It will require readers to check the body to see if something is
a method or a property.
Not very nice syntax.
Arne
.
- Follow-Ups:
- Re: Do we have extention properties in C# 3.0?
- From: Peter Duniho
- Re: Do we have extention properties in C# 3.0?
- References:
- Do we have extention properties in C# 3.0?
- From: Max2006
- Re: Do we have extention properties in C# 3.0?
- From: Arne Vajhøj
- Re: Do we have extention properties in C# 3.0?
- From: Peter Duniho
- Do we have extention properties in C# 3.0?
- Prev by Date: Re: Proper design of classes
- Next by Date: Re: Proper design of classes
- Previous by thread: Re: Do we have extention properties in C# 3.0?
- Next by thread: Re: Do we have extention properties in C# 3.0?
- Index(es):
Relevant Pages
|