• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.HttpExtensions
    • AuthorizationExtensions
    • HttpBehaviour
    • HttpBehaviourExtensions
    • HttpClientExtensions
    • HttpContentExtensions
    • HttpExtensionsGlobals
    • HttpRequestMessageConfiguration
    • HttpRequestMessageExtensions
    • HttpResponse
    • HttpResponse<TResponse, TErrorResponse>
    • HttpResponse<TResponse>
    • HttpResponseMessageExtensions
    • HttpResponseWithError<TErrorResponse>
    • IChangeableHttpBehaviour
    • IHttpBehaviour
    • IHttpContentConverter
    • IHttpRequestConfiguration
    • IHttpSettings
    • IJsonSerializer
    • MiscExtensions
    • UriActionExtensions
    • UriModifyExtensions
    • UriParseExtensions
  • Dapplo.HttpExtensions.ContentConverter
    • ByteArrayHttpContentConverter
    • DefaultJsonHttpContentConverter
    • DefaultJsonHttpContentConverterConfiguration
    • FormUriEncodedContentConverter
    • StreamHttpContentConverter
    • StringConfiguration
    • StringHttpContentConverter
    • SyndicationFeedHttpContentConverter
    • XDocumentHttpContentConverter
  • Dapplo.HttpExtensions.Extensions
    • EnumExtensions
    • HttpBehaviourExtensions
    • StringExtensions
    • TypeExtensions
  • Dapplo.HttpExtensions.Factory
    • HttpClientFactory
    • HttpContentFactory
    • HttpMessageHandlerFactory
    • HttpRequestMessageFactory
    • WebProxyFactory
  • Dapplo.HttpExtensions.JsonNet
    • JsonNetJsonSerializer
    • ReadOnlyConsideringContractResolver
  • Dapplo.HttpExtensions.JsonSimple
    • DataContractJsonSerializerStrategy
    • DefaultJsonHttpContentConverter
    • IJsonSerializerStrategy
    • JsonExtensionDataAttribute
    • PocoJsonSerializerStrategy
    • SimpleJson
    • SimpleJsonSerializer
  • Dapplo.HttpExtensions.Listener
    • HttpListenerContextExtensions
    • ListenerPortExtensions
    • UriHttpListenerExtensions
  • Dapplo.HttpExtensions.OAuth
    • AuthorizeModes
    • BaseOAuthSettings
    • GrantTypes
    • ICodeReceiverSettings
    • IOAuth1Token
    • IOAuth2Token
    • IOAuthCodeReceiver
    • OAuth1HttpBehaviour
    • OAuth1HttpBehaviourFactory
    • OAuth1HttpMessageHandler
    • OAuth1Parameters
    • OAuth1RequestConfiguration
    • OAuth1Settings
    • OAuth1SignatureTransports
    • OAuth1SignatureTypes
    • OAuth1Token
    • OAuth2HttpBehaviourFactory
    • OAuth2HttpMessageHandler
    • OAuth2Settings
    • OAuth2TokenResponse
    • OAuthExtensions
  • Dapplo.HttpExtensions.OAuth.CodeReceivers
    • EmbeddedBrowserCodeReceiver
  • Dapplo.HttpExtensions.OAuth.Desktop
    • OAuthLoginForm
  • Dapplo.HttpExtensions.Support
    • HttpPartAttribute
    • HttpParts
    • HttpRequestAttribute
    • HttpResponseAttribute
    • HttpSettings
    • MediaTypes
    • ProgressStream
    • ProgressStreamReport
  • Dapplo.HttpExtensions.SystemTextJson
    • SystemTextJsonSerializer
  • Dapplo.HttpExtensions.WinForms.ContentConverter
    • BitmapConfiguration
    • BitmapHttpContentConverter
  • Dapplo.HttpExtensions.Wpf.ContentConverter
    • BitmapSourceConfiguration
    • BitmapSourceHttpContentConverter

Class SimpleJson

This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/ JSON uses Arrays and Objects. These correspond here to the datatypes JsonArray(IList<object>) and JsonObject(IDictionary<string,object>). All numbers are parsed to doubles.

Inheritance
System.Object
SimpleJson
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dapplo.HttpExtensions.JsonSimple
Assembly: Dapplo.HttpExtensions.JsonSimple.dll
Syntax
public static class SimpleJson

Properties

| Improve this Doc View Source

CurrentJsonSerializerStrategy

Declaration
public static IJsonSerializerStrategy CurrentJsonSerializerStrategy { get; set; }
Property Value
Type Description
IJsonSerializerStrategy
| Improve this Doc View Source

DataContractJsonSerializerStrategy

Declaration
public static DataContractJsonSerializerStrategy DataContractJsonSerializerStrategy { get; }
Property Value
Type Description
DataContractJsonSerializerStrategy
| Improve this Doc View Source

PocoJsonSerializerStrategy

Declaration
public static PocoJsonSerializerStrategy PocoJsonSerializerStrategy { get; }
Property Value
Type Description
PocoJsonSerializerStrategy

Methods

| Improve this Doc View Source

DeserializeObject(String)

Parses the string json into a value

Declaration
public static object DeserializeObject(string json)
Parameters
Type Name Description
System.String json

A JSON string.

Returns
Type Description
System.Object

An IList<object>, a IDictionary<string,object>, a double, a string, null, true, or false

| Improve this Doc View Source

DeserializeObject(String, Type, IJsonSerializerStrategy)

Declaration
public static object DeserializeObject(string json, Type type, IJsonSerializerStrategy jsonSerializerStrategy = null)
Parameters
Type Name Description
System.String json
System.Type type
IJsonSerializerStrategy jsonSerializerStrategy
Returns
Type Description
System.Object
| Improve this Doc View Source

DeserializeObject<T>(String, IJsonSerializerStrategy)

Declaration
public static T DeserializeObject<T>(string json, IJsonSerializerStrategy jsonSerializerStrategy = null)
Parameters
Type Name Description
System.String json
IJsonSerializerStrategy jsonSerializerStrategy
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

EscapeToJavascriptString(String)

Declaration
public static string EscapeToJavascriptString(string jsonString)
Parameters
Type Name Description
System.String jsonString
Returns
Type Description
System.String
| Improve this Doc View Source

Minify(String)

minify(compress) the JSON string. inspired by http://stackoverflow.com/questions/8913138/minify-indented-json-string-in-net

Declaration
public static string Minify(string json)
Parameters
Type Name Description
System.String json

JSON string to compress

Returns
Type Description
System.String

minified JSON string

| Improve this Doc View Source

SerializeObject(Object, IJsonSerializerStrategy)

Converts a IDictionary<string,object> / IList<object> object into a JSON string

Declaration
public static string SerializeObject(object json, IJsonSerializerStrategy jsonSerializerStrategy = null)
Parameters
Type Name Description
System.Object json

A IDictionary<string,object> / IList<object>

IJsonSerializerStrategy jsonSerializerStrategy

Serializer strategy to use

Returns
Type Description
System.String

A JSON encoded string, or null if object 'json' is not serializable

| Improve this Doc View Source

TryDeserializeObject(String, out Object)

Try parsing the json string into a value.

Declaration
public static bool TryDeserializeObject(string json, out object obj)
Parameters
Type Name Description
System.String json

A JSON string.

System.Object obj

The object.

Returns
Type Description
System.Boolean

Returns true if successfull otherwise false.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © Dapplo