Skip to content

Conditional Compilation Symbols

prabirshrestha edited this page Mar 5, 2012 · 1 revision

Define appropriate conditional compilation symbol depending on your framework

.NET 2.0+ (including .NET 3.0/3.5/4.0/4.5)

#define SIMPLE_JSON_REFLECTIONEMIT

Windows Runtime (Windows Metro Style Apps)

#define NETFX_CORE

NETFX_CORE is automatically defined for new WinRT projects by Visual Studio.

Silverlight 4+, .NET 4.0+ and WinRT (.net frameworks which supports dynamic)

#define SIMPLE_JSON_DYNAMIC

DataContract/DataMember support

#define SIMPLE_JSON_DATACONTRACT

You are also required to reference System.Runtime.Serialization library.

Hiding SimpleJson class

#define SIMPLE_JSON_INTERNAL

This will make the SimpleJson class to internal class instead of public.

Hiding JsonArray and JsonObject class

#define SIMPLE_JSON_OBJARRAYINTERNAL

This will make the JsonArray and JsonObject classes to internal class instead of public. You can cast JsonObject to IDictionary<string,object> or IDictionary<string,dynamic> and JsonArray to IList<object> or IList<dynamic>.

Clone this wiki locally