示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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
            });
        }
示例#4
0
        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);
        }