using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 原始碼修改{ class Program { static void Main(string[] args) { Menu.ShowIntroduce(); Command command ; while (true) { Menu.ShowCommand(); command = Menu.GetCommand(); if (command == Command.R) { Menu.ShowPacify(); // 執行產生翻譯文檔邏輯 ReadDocument readDocument = new ReadDocument(); // 判斷是否已存在翻譯文檔 if (!readDocument.HasFoundDocument) { // 建立一個翻譯文檔 readDocument.CreateANewDocument(); } // 判斷是否已有已存在格式正確的翻譯文檔 if (readDocument.DocumentFormatIsOK) { readDocument.OverReading(); Menu.ShowFoundAnExistentDocument(); Menu.ShowExit(); Menu.WaitForExit(); return; } readDocument.OverReading(); WriteDocument writeDocument = new WriteDocument(); ReadSourceFile readSourceFile = new ReadSourceFile(writeDocument); TravelAllFiles trevel = new TravelAllFiles(); trevel.Go(readSourceFile); writeDocument.OverWritting(); Menu.ShowCommandRExcutedSuccessfully(); Menu.ShowExit(); Menu.WaitForExit(); return; } else if (command == Command.W) { Menu.ShowPacify(); // 執行根據已翻譯文檔修改原始碼邏輯 ReadDocument readDocument = new ReadDocument(); if (!readDocument.HasFoundDocument) { Menu.ShowHasNotFoundDocument(); Menu.ShowExit(); Menu.WaitForExit(); return; } if (!readDocument.DocumentFormatIsOK) { readDocument.OverReading(); Menu.ShowErrorOnFormat(); Menu.ShowExit(); Menu.WaitForExit(); return; } WriteSourceFile writeSourceFile = new WriteSourceFile(readDocument); TravelAllFiles travel = new TravelAllFiles(); travel.Go(writeSourceFile); Menu.ShowCommandWExcutedSuccessfully(writeSourceFile.AmountOfChanges); Menu.ShowExit(); Menu.WaitForExit(); return; } else if (command == Command.C) { Menu.ShowPacify(); ConvertEncodingToUTF8 convert = new ConvertEncodingToUTF8() ; TravelAllFiles travel = new TravelAllFiles(); travel.Go(convert); Menu.ShowCommandCExcutedSuccessfully(convert.AmountOfHasConverted); Menu.ShowExit(); Menu.WaitForExit(); return; } else if (command == Command.H) { Menu.ShowHelp(); } else if (command == Command.Q) return; else Menu.ShowErrorAboutCommand(); } } }}