Thrift: C# Bindings.

Summary:
C# generator, library, and MS Build task contributed by imeem.

Reviewed By: mcslee

Test Plan:
Built the Thrift compiler and generated some C# code.
I'd love to say I installed Mono or Portable.NET and built the C# code,
but I did not.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665421 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/csharp/src/Protocol/TProtocolException.cs b/lib/csharp/src/Protocol/TProtocolException.cs
new file mode 100644
index 0000000..0941a81
--- /dev/null
+++ b/lib/csharp/src/Protocol/TProtocolException.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Thrift.Protocol
+{
+	class TProtocolException : Exception
+	{
+		public const int UNKNOWN = 0;
+		public const int INVALID_DATA = 1;
+		public const int NEGATIVE_SIZE = 2;
+		public const int SIZE_LIMIT = 3;
+		public const int BAD_VERSION = 4;
+
+		protected int type_ = UNKNOWN;
+
+		public TProtocolException()
+			: base()
+		{
+		}
+
+		public TProtocolException(int type)
+			: base()
+		{
+			type_ = type;
+		}
+
+		public TProtocolException(int type, String message)
+			: base(message)
+		{
+			type_ = type;
+		}
+
+		public TProtocolException(String message)
+			: base(message)
+		{
+		}
+
+		public int getType()
+		{
+			return type_;
+		}
+	}
+}