using System;
// A single line comment starting at the beginning of the line
using System.IO;
/* A comment block starting at the beginning of the line */
using MyNamespace;
namespace CSharpTest
{
// A comment containing what looks like a "string"
// A comment containg /* what looks like */ a block comment
/* A multiline comment
* also containing a // regular comment
* And containing what looks like a "string"
*/
public class Program
{
/// <summary>
/// An XML comment <see cref="System.String" />.
/// </summary>
public static void Main()
{
int Int; // case sensitive test
int @int ; // escaping test
Console .WriteLine( "A string \" \\\" hello \t\\" );
Console .WriteLine( "A string containing what // looks like a comment." ); // followed by a real comment
Console .WriteLine( @"An @ string"" \" ); /* and another comment */
Console .WriteLine( @"Another @ string """"" );
Console .WriteLine( "{0} {1} {2}" , "more than one\\" , /* embedded comment */ @"string on ""the same" , "line" );
#if PREPROCESSORTEST
for ( int x = 0; x < 10; ++x )
{
Console .WriteLine( 'x' );
Console .WriteLine( '\'' );
Console .WriteLine( '\\' );
}
#endif
}
public static void Linq()
{
IObservable < Event < MouseEventArgs >> draggingEvent =
from mouseLeftDownEvent in control.GetMouseLeftDown( )
from mouseMoveEvent in control.GetMouseMove( ).Until( control.GetMouseLeftUp( ) )
let comparer = new MouseEventComparer( mouseMoveEvent )
group mouseMoveEvent by comparer into cluster
select cluster;
}
}
}
Source: https://habr.com/ru/post/78106/
All Articles