public static JsonSerializerSettings CreateDefault() { var s = JsonNetSerializer.CreateDefault(); s.ContractResolver = new CustomSignalRContractResolverBecauseOfIssue500InSignalR(); return(s); }
private static RemoteInstanceSetting[] GetRemoteInstances() { var valueRead = SettingsReader <string> .Read("RemoteInstances"); if (!string.IsNullOrEmpty(valueRead)) { var jsonSerializer = Newtonsoft.Json.JsonSerializer.Create(JsonNetSerializer.CreateDefault()); using (var jsonReader = new JsonTextReader(new StringReader(valueRead))) { return(jsonSerializer.Deserialize <RemoteInstanceSetting[]>(jsonReader) ?? new RemoteInstanceSetting[0]); } } return(new RemoteInstanceSetting[0]); }