J
Jim S
My company's code often includes locks, using statements, and
try/catch blocks and ends up with a lot of brackets. Would it make
sense for C# to allow multiple items in these types of blocks?
i.e.
lock (this.var1, this.var2)
{
using (Font font=this.CreateFont(), Brush brush=this.CreateBrush())
{
... do something with font, brush, var1, var2
}
}
Also, has there been talk about allowing a single lock statement to
apply to both the getter and setter of a property?
Maybe like this:
int Value lock(this.val) { get { return this.val; } set { this.val =
value; } }
try/catch blocks and ends up with a lot of brackets. Would it make
sense for C# to allow multiple items in these types of blocks?
i.e.
lock (this.var1, this.var2)
{
using (Font font=this.CreateFont(), Brush brush=this.CreateBrush())
{
... do something with font, brush, var1, var2
}
}
Also, has there been talk about allowing a single lock statement to
apply to both the getter and setter of a property?
Maybe like this:
int Value lock(this.val) { get { return this.val; } set { this.val =
value; } }