You've already forked TranslationApp
mirror of
https://github.com/lifebottle/TranslationApp.git
synced 2026-02-13 15:25:58 -08:00
37 lines
1.0 KiB
C#
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);
|
|
}
|
|
}
|
|
} |