This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class Program { | |
public static CustomType ReturnArgument (CustomType arg) { | |
return arg; | |
} | |
public static void Main (string[] args) { | |
var a = new CustomType(1); | |
var b = new CustomType(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class Program { | |
public static void Main (string[] args) { | |
int i = 0; | |
a: | |
i += 1; | |
Console.WriteLine("a"); | |
for (; i < 16; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program { | |
public static void Main (string[] args) { | |
Console.WriteLine( | |
Battlestar<object>.instance.commander | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class Program { | |
public static void Main (string[] args) { | |
// [y, x], not [x, y]! | |
var a = new string[5, 10]; | |
var h = a.GetLength(0); | |
var w = a.GetLength(1); | |
for (var y = 0; y < h; y++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class Program { | |
public static void Main (string[] args) { | |
int x = 1; | |
string y = "y"; | |
Func<string> a = () => { | |
return String.Format("x={0}, y={1}", x, y); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using JSIL; | |
using JSIL.Meta; | |
public static class Program { | |
public static int x = 10; | |
public static int y = 20; | |
public static void Main () { | |
dynamic document = Builtins.Global["document"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://msdn.microsoft.com/en-us/library/aa645739%28v=vs.71%29.aspx | |
// events1.cs | |
using System; | |
namespace MyCollections | |
{ | |
using System.Collections; | |
// A delegate type for hooking up change notifications. | |
public delegate void ChangedEventHandler(object sender, EventArgs e); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The Computer Language Benchmarks Game | |
http://shootout.alioth.debian.org/ | |
contributed by Isaac Gouy, optimization and use of more C# idioms by Robert F. Tobler | |
*/ | |
using System; | |
public static class Program { | |
public static void Main () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class Program { | |
public enum SimpleEnum { | |
A, | |
B = 3, | |
C, | |
D = 10 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Foo { | |
public void Func1 () { | |
Console.Write("F1 "); | |
} | |
public virtual void Func2 () { | |
Console.Write("F2 "); | |
this.Func1(); |
OlderNewer