public void DeserializeContent(string dataDir, Base_Json json) { ContentPage_Json contentPage = json as ContentPage_Json; foreach (var content in contentPage.content) { DeserializeContentItem(content, dataDir); } if (contentPage.filters != null) { foreach (var filter in contentPage.filters) { FilterGroup fg = new FilterGroup() { ID = filter.id != null ? filter.id : "", Header = filter.title != null ? filter.title : "Filter by Unknown", ShowExlusiveToggle = filter.showExclusiveToggle, ExclusiveToggleLabel = filter.exclusiveToggleLabel != null ? filter.exclusiveToggleLabel : "Exclude unchecked options", IsExclusive = filter.isExclusive }; foreach (var option in filter.options) { fg.AddItem(option.id, option.display); } _FilterGroups.Add(fg); } } }
public void DeserializeContent(string dataDir, Base_Json json) { Classes_Json classes = json as Classes_Json; foreach (var charClass in classes.classes) { _Content.Add( DeserializeSingleClass(dataDir, charClass)); } if (classes.filters != null) { foreach (var filter in classes.filters) { FilterGroup fg = new FilterGroup() { ID = filter.id != null ? filter.id : "", Header = filter.title != null ? filter.title : "Filter by Unknown", ShowExlusiveToggle = filter.showExclusiveToggle, ExclusiveToggleLabel = filter.exclusiveToggleLabel != null ? filter.exclusiveToggleLabel : "Exclude unchecked options", IsExclusive = filter.isExclusive }; foreach (var option in filter.options) { fg.AddItem(option.id, option.display); } _FilterGroups.Add(fg); } } if (Content.Count() <= 0) { throw new ArgumentNullException("No classes were loaded from classes json file. Is the file empty?"); } }