Specifying properties when initialising

Posted by maxp on Stack Overflow See other posts from Stack Overflow or by maxp
Published on 2010-03-29T11:52:38Z Indexed on 2010/03/29 12:03 UTC
Read the original article Hit count: 372

Filed under:
|
void Foo()
{

bool ID = "test";
var testctrl = new Control() {ID = (ID**=="abc"?ID:ID**)};

}

Is it possible to get the value of ID** in the code above? The problem is they both have the same property names.

Please ignore the fact the specific ID assignment is pointless, im just using it as an example.

© Stack Overflow or respective owner

Related posts about constructors

Related posts about c#