Files
TranslationApp/TranslationLib/TranslationProject.cs
2022-08-27 07:50:18 -04:00

37 lines
1.0 KiB
C#

using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace TranslationLib
{
public class TranslationProject
{
public string ProjectPath { get; }
public List<XMLFolder> XmlFolders { get; set; }
public XMLFolder CurrentFolder { get; set; }
public TranslationProject(string basePath, List<string> folderIncluded)
{
ProjectPath = basePath;
XmlFolders = new List<XMLFolder>();
foreach (var folder in folderIncluded)
XmlFolders.Add(new XMLFolder(folder, Path.Combine(basePath, folder, "XML")));
foreach (var xmlFolder in XmlFolders)
xmlFolder.LoadXMLs();
CurrentFolder = XmlFolders.First();
}
public List<string> GetFolderNames()
{
return XmlFolders.Select(x => x.Name).ToList();
}
public void SetCurrentFolder(string name)
{
CurrentFolder = XmlFolders.First(x => x.Name == name);
}
}
}