private static PropertyContractResolver GetResolver()
        {
            PropertyContractResolver resolver = new PropertyContractResolver();

            resolver.IgnoreProperty(typeof(PreferenceData), nameof(PreferenceData.PreferenceLocation));
            resolver.IgnoreProperty(typeof(ObservableDirtyObject), nameof(PreferenceData.IsDirty));
            return(resolver);
        }
示例#2
0
        private static JsonSerializerSettings GetSettings()
        {
            JsonSerializerSettings   settings = new JsonSerializerSettings();
            PropertyContractResolver resolver = new PropertyContractResolver();

            resolver.IgnoreProperty(typeof(FileObject), nameof(Recipe.Info));
            resolver.IgnoreProperty(typeof(ObservableDirtyObject), nameof(Recipe.IsDirty));
            resolver.SetAllLetterCase(Lettercase.Lowercase);
            resolver.SetNullStringEmpty(true);
            settings.ContractResolver = resolver;
            settings.Converters.Add(new RecipeJsonConverter());
            return(settings);
        }