Exemplo n.º 1
0
        public List <string> GetBackgroundInFolder(string actualDirectory)
        {
            var backgroundFiles = new List <string>();

            if (!String.IsNullOrEmpty(actualDirectory))
            {
                backgroundFiles =
                    this.fileHandler.GetListOfBackgrounds(actualDirectory + GlobalVariables.ConfigResource("BackgroundRes"));
            }
            return(backgroundFiles);
        }
Exemplo n.º 2
0
        public Dictionary <string, string[]> GetObjectsInFolder(string actualDirectory)
        {
            var resultObjects = new Dictionary <string, string[]>();

            if ((actualDirectory != null) && (!String.IsNullOrEmpty(actualDirectory)))
            {
                Dictionary <string, string[]> characterObj =
                    this.fileHandler.GetListOfObjects(actualDirectory + GlobalVariables.ConfigResource("CharacterRes"));

                Dictionary <string, string[]> character2DObj =
                    fileHandler.GetListOfObjects(actualDirectory + GlobalVariables.ConfigResource("Character2DRes"));

                resultObjects = characterObj.Union(character2DObj).ToDictionary(k => k.Key, v => v.Value);
            }
            return(resultObjects);
        }
Exemplo n.º 3
0
        public ActionResult AddNewBook(string newFileName)
        {
            activeUser = User.Identity.Name;
            string[] listOfBooks = null;
            systemMssg = string.Empty;

            if (activeUser != null)
            {
                try
                {
                    systemMssg  = this.fileHandler.AddNewBook(newFileName, activeUser);
                    listOfBooks = this.fileHandler.GetListOfUserBooks(activeUser);
                    systemMssg  = aBookRepository.SetActualFile(String.Format("{0}{1}/Books/{2}/{3}.xml", GlobalVariables.ConfigResource("UsersDirectory"), activeUser, newFileName, newFileName));
                    if (newFileName != null)
                    {
                        aBook = this.aBookRepository.GetAllContent();
                    }
                }
                catch (Exception e)
                {
                    systemMssg = e.Message;
                }
            }
            else
            {
                systemMssg = "Couldn't add new book.";
            }
            ViewBag.statusMsg       = systemMssg;
            ViewData["listOfBooks"] = listOfBooks;
            return(this.PartialView("ListOfBooks"));
        }