public IEnumerable <Domain.MenuItem> GetMenu(string dictaatName) { var path = _pathHelper.MenuConfigPath(dictaatName); IEnumerable <Domain.MenuItem> menu = null; string menuString = _file.TryReadFile(path); if (menuString != null) { menu = Newtonsoft.Json.JsonConvert.DeserializeObject <IEnumerable <Domain.MenuItem> >(menuString); } return(menu); }
public Menu GetMenu(string dictaatName) { var path = _pathHelper.MenuConfigPath(dictaatName); Menu menu = null; string menuString = _file.TryReadFile(path); if (menuString != null) { menu = Newtonsoft.Json.JsonConvert.DeserializeObject <Menu>(menuString); } return(menu); }
public ViewModels.DictaatPage GetDictaatPage(string dictaatName, string fileName) { string path = _pathHelper.PagePath(dictaatName, fileName); string content = _file.TryReadFile(path); if (content == null) { //wellicht in de toekomst 404 terug sturen? File not found? throw new System.IO.FileNotFoundException(); } return(new ViewModels.DictaatPage() { Name = fileName, Source = content }); }
public String GetDictaatStyling(string dictaatName, string fileName = null) { string path = _pathHelper.StylePath(dictaatName, fileName); if (!_file.Exists(path)) { _file.TryCreateFile(path); } string content = _file.TryReadFile(path); if (content == null) { //wellicht in de toekomst 404 terug sturen? File not found? throw new System.IO.FileNotFoundException(); } return(content); }