Program.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using CommonUI.Data;
  2. using System;
  3. using System.IO;
  4. using System.Text;
  5. namespace CommonUI_Win32
  6. {
  7. static class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. if (args.Length > 0)
  12. {
  13. switch (args[0])
  14. {
  15. case "xml2bin":
  16. ConvertXml2Bin(args);
  17. return;
  18. }
  19. }
  20. Console.WriteLine(Usage);
  21. }
  22. private static void ConvertXml2Bin(string[] args)
  23. {
  24. string root = ".";
  25. if (args.Length > 1 && Directory.Exists(args[1]))
  26. {
  27. root = args[1];
  28. }
  29. new UIEditorConverter().ConvertXML(new DirectoryInfo(root));
  30. }
  31. public static string Usage
  32. {
  33. get
  34. {
  35. StringBuilder sb = new StringBuilder("UI工具集");
  36. sb.AppendLine("1. UI编辑器Xml转换Bin");
  37. sb.AppendLine(" CommonUI_Win32.exe xml2bin <输入文件夹>");
  38. return sb.ToString();
  39. }
  40. }
  41. }
  42. }