Hi,
Does anyone know of the C# alternative to VB.NET 'with' syntax
ie VB.NET...
with obj_Widget
.name = "widget1"
.height = 10
.width = 20
end with
instead of C#...
obj_Widget.name = "widget1";
obj_Widget.height = 10;
obj_Widget.width = 20;
'With' appears more compact and concise considering long
object names (with full namespace declaration).
Thanks
Richard White

C# Syntax
ITJ
o.name = "widget1";
o.height = 10;
o.width = 20;
I don't personally code like this, but this has the same advantages and disadvantages as VB's "With".
Advantage: less typing
Disadvantage: 'o.' is obscure (vs VB "With" where "." is obscure)
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up VB.NET code
Samuel Cheah
WKleinschmit
no, C# hasn't such a construct, you have to manually write out full names/props...
Greetings,
Konstantin
Travis McPhail