//implement JsonConverter.ReadJson
        public override object ReadJson(JsonReader reader,
                                        Type objectType, object existingValue, JsonSerializer serializer)
        {
            JObject item = JObject.Load(reader);

            return(ToolboxToolState.GetToolboxToolFromJsonObject(item));
        }
Exemple #2
0
        private static void UpdateActiveToolSetting(Book.Book book, string toolName, bool enabled)
        {
            var tools = book.BookInfo.Tools;
            var item  = tools.FirstOrDefault(t => t.ToolId == toolName);

            if (item == null)
            {
                item = ToolboxToolState.CreateFromToolId(toolName);
                tools.Add(item);
            }
            item.Enabled = enabled;
        }