Monday, March 3, 2014

C# - Declaring Events

Events are closely related to delegates, but they are not the same thing. An event allows code to subscribe and unsubscribe using delegate instances as event handlers. The idea is that when an event is raised all the event handlers which have subscribed to the event are called. Just as a property is logically just two operations get and set, an event is also logically just two operations: subscribe and unsubscribe. To declare an event and explicitly write these operations, you use syntax which looks like a property declaration but with add...

C# - String Literals

C# has two kinds of string literals – the regular ones, and verbatim string literals which are of the form @”text”. Regular string literals have to start and end on the same line of source code. A backslash within a string literal is interpreted as an escape sequence as per shown below. Escape Sequence Result in string \’ Single quote (This is usually used in character literals. Character literals use the same escape sequence as string literals.) \” Double quote \\ Backslash \0 ...

Freemarket.com Marketplace