R
Rory Becker
I was hoping to get the opinion of Bill McCarthy and Jon Skeet ( I do enjoy
their "discussions" ) on a suggestion I made to the VBTeam on a new keyword
"Exposes".
I know it's just syntactic sugar but I thought it might be nice all the same
It would work like Extension methods in that 2.0 compatible IL would be generated
and it would not change the runtime requirements but just a new compiler.
My keyword would allow the compression of existing code like
-------------------------------------------------------------
Private MyLabel as Label ' Assume instantiation elsewhere
Public Property LabelText as String
Get
return MyLabel.Text
End Get
Set(Value as String)
MyLabel.Text = Value
End Set
End Property
-------------------------------------------------------------
to
-------------------------------------------------------------
Private MyLabel as Label ' Assume instantiation elsewhere
Property LabelText Exposes MyLabel.Text
-------------------------------------------------------------
Or
-------------------------------------------------------------
Private MyTextBox as TextBox ' Assume instantiation elsewhere
Public Readonly Property Value() as String
Get
return MyTextBox.Text
End Get
End Property
-------------------------------------------------------------
to
-------------------------------------------------------------
Private MyTextBox as TextBox ' Assume instantiation elsewhere
Property Readonly Value Exposes MyTextBox.Text
-------------------------------------------------------------
I have suggested this in many places but have yet to recieve comments on it.
Just interested to know what people think.
I see it as helping reduce the chaff in the creation of composite controls
but it could be used in other situations.
What do you think
their "discussions" ) on a suggestion I made to the VBTeam on a new keyword
"Exposes".
I know it's just syntactic sugar but I thought it might be nice all the same
It would work like Extension methods in that 2.0 compatible IL would be generated
and it would not change the runtime requirements but just a new compiler.
My keyword would allow the compression of existing code like
-------------------------------------------------------------
Private MyLabel as Label ' Assume instantiation elsewhere
Public Property LabelText as String
Get
return MyLabel.Text
End Get
Set(Value as String)
MyLabel.Text = Value
End Set
End Property
-------------------------------------------------------------
to
-------------------------------------------------------------
Private MyLabel as Label ' Assume instantiation elsewhere
Property LabelText Exposes MyLabel.Text
-------------------------------------------------------------
Or
-------------------------------------------------------------
Private MyTextBox as TextBox ' Assume instantiation elsewhere
Public Readonly Property Value() as String
Get
return MyTextBox.Text
End Get
End Property
-------------------------------------------------------------
to
-------------------------------------------------------------
Private MyTextBox as TextBox ' Assume instantiation elsewhere
Property Readonly Value Exposes MyTextBox.Text
-------------------------------------------------------------
I have suggested this in many places but have yet to recieve comments on it.
Just interested to know what people think.
I see it as helping reduce the chaff in the creation of composite controls
but it could be used in other situations.
What do you think