"djc" <no***@nowhere.coma écrit dans le message de news:
OT**************@TK2MSFTNGP03.phx.gbl...
| in vb there is a With construct. It supposedly speeds things up. By
caching,
| I assume, it eliminates having to travel several levels in a hierarchy
using
| the dot operator. Is there a C# equivalent of this? A quick look at VS
help
| only brought up VB stuff for it.
|
| With ObjectVar
| .this
| .that
| .whatever()
| End With
The only point behind the with construct is to save typing code.
If you have to do several things with a sub-property, then you can always
assign to a local variable and use that instead.
{
string shortcut = This.That.Other.Name;
shortcut.this;
shortcut.that;
shortcut.whatever();
}
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer