PLS wrote:
VB.NET allows defining a property that has different get and set types
by doing this
Public Property fFlag(ByVal flag as flagEnumeration) As Boolean
Get
Return ...
End Get
Set(ByBal Value as Boolean)
...
End Set
End Property
What is the C# equivalent of this?
I'm not really clear on what behavior you're looking for here. The code
you posted has a Boolean property, that returns a Boolean and has a
setter than takes a Boolean as a parameter.
So, I don't see how the property defined in the code you posted "has
different get and set types".
Now, that said, a C# property cannot have a parameter list as the
property you've posted does. You can have an indexer, which is like a
property that takes one or more parameters, and which looks a lot like
an array syntax-wise.
Maybe that's the kind of behavior you're trying to achieve?
http://msdn2.microsoft.com/en-us/library/6x16t2tx.aspx
Note that there can be only one indexer for a class. You can't define
an arbitrarily-named property that takes parameters.
Pete