コード例 #1
0
        public static JsonSerializerSettings CreateDefault()
        {
            var s = JsonNetSerializer.CreateDefault();

            s.ContractResolver = new CustomSignalRContractResolverBecauseOfIssue500InSignalR();
            return(s);
        }
コード例 #2
0
ファイル: Settings.cs プロジェクト: ramonsmits/ServiceControl
        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]);
        }