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
/* Given: */ | |
// An interface | |
interface ICountable | |
{ | |
int Count { get; } | |
} | |
// A class that 'should' implement the interface | |
class Foo | |
{ |
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; | |
namespace DeltaExample | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Δ(); | |
} |
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
class Program { | |
static bool M(out int x) | |
{ | |
x = 123; | |
return true; | |
} | |
static int N(EvilBool d) | |
{ |
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; | |
static class Program | |
{ | |
internal delegate D D(D d); | |
static void Main(string[] args) | |
{ | |
for (var d = Count(10, (Print("hello")))(Print("done"))(Done); ;) | |
{ |
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 System.Runtime.InteropServices; | |
class Foo | |
{ | |
} | |
class Program | |
{ | |
static IntPtr AllocAndGetPointer() |
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 System.Runtime.InteropServices; | |
[StructLayout(LayoutKind.Sequential)] | |
struct Foo | |
{ | |
public int Value; | |
} | |
class Program |
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 System.Runtime.InteropServices; | |
[StructLayout(LayoutKind.Sequential)] | |
struct Foo | |
{ | |
private IntPtr _realFoo; | |
public override string ToString() | |
{ |
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 System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
namespace ExampleApplication | |
{ | |
public class Haywire | |
{ | |
private readonly List<RouteCallback> _routeCallbacks = new List<RouteCallback>(); // store these in here to prevent them being GC'd | |
private ResponseCompleteCallback _responseCompleteCallback; // ditto, but I've assumed only one can be active at any one time |
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 System.Drawing; | |
using Properties; | |
namespace Example | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
Does: | |
- Support AtomPub. | |
- Ensure this works with Windows Live writer. | |
- Content-negiotiate everything. | |
- Atom (also supplied when requesting XML) | |
- HTML (via Razor templates, or XSLT transforms of XML content) | |
- JSON (just works, but needs tidying up) | |
- Output caching on server side. | |
- DNSBL. | |
- GZIP compression (needs to do in-proc to work around IIS bug regarding Vary header). |