private void Translat() { ClassIdent indentificator = new ClassIdent(); switch (indentificator.GetClassType(txtInput.Text)) { case ClassTypeEnum.MessageOrType: MessageParser parser = new MessageParser(txtInput.Text); MessageGenerator generator = new MessageGenerator(parser.GetClass(), @"C:\Users\Home\Desktop\class"); // try // { txtOutput.Text = File.ReadAllText(@"C:\Users\Home\Desktop\class\" + parser.GetClass().Name + ".cs", new UTF8Encoding()); // } // catch { } break; case ClassTypeEnum.GameData: break; } }
public static void GenerateDirectory(string inputPath, string outputPath) { ClassIdent identificator = new ClassIdent(); DirectoryInformations directoryInfos = new DirectoryInformations(inputPath); identificator.SortDirectory(directoryInfos.Files.ToArray()); OnStatsChang("Traduction des gameData..."); GameDataBulkGenerator gbg = new GameDataBulkGenerator(); gbg.FileTranslated += eFileTranslated; gbg.LoadInfo += eLoadInfo; gbg.GenerateDirectory(identificator.GameDatas, inputPath, outputPath); OnStatsChang("Nettoyage des messages et types..."); BulkCleaner bc = new BulkCleaner(); bc.FileTranslated += eFileTranslated; bc.LoadInfo += eLoadInfo; bc.CleanDirectory(identificator.TypesOrMessages); OnStatsChang("Traduction des messages et types..."); NetworkulkGenerator mbg = new NetworkulkGenerator(); mbg.FileTranslated += eFileTranslated; mbg.LoadInfo += eLoadInfo; mbg.GenerateDirectory(identificator.TypesOrMessages, inputPath, outputPath); OnStatsChang("Traduction des enums..."); EnumBulkGenerator ebg = new EnumBulkGenerator(); ebg.LoadInfo += eLoadInfo; ebg.FileTranslated += eFileTranslated; ebg.GenerateDirectory(identificator.Enums, inputPath, outputPath); OnStatsChang("Traduction terminer"); }