C# Tricks

#region
… your code here inside a collapsible region.
#endregion

Save code in the toolbox, and use them later on.
Drag the selected lines of code into the General tab of the toolbox and drop them.

Ternary operator : ?

bool informal = true;
string name =informal : "Chuck" ? "Charles";  // Returns "Chuck"

Leave a Reply

Your email address will not be published. Required fields are marked *