1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using CommandLine;
- using Newtonsoft.Json;
- using System.Data;
- using System.Text;
- namespace etoy
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("*********************************");
- Console.WriteLine(" 欢迎来到EToy配置表工具");
- Console.WriteLine("*********************************");
- Console.WriteLine();
- Console.WriteLine($"Path:{System.Environment.CurrentDirectory}");
- Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
-
- //Parser.Default.ParseArguments<Option>(args).WithParsed(option =>
- //{
- // var blackboard = new Blackboard();
- // var context = new Context(option, blackboard);
- // var commands = CommandGroupFactory.Create(context);
- // var pileLine = new ConfigurePileline(commands);
- // pileLine.Run();
- //});
- //Console.ReadLine();
- var option = ReadOption();
- var blackboard = new Blackboard();
- var context = new Context(option, blackboard);
- var commands = CommandGroupFactory.Create(context);
- var pileLine = new ConfigurePileline(commands);
- pileLine.Run();
- }
- private static Option ReadOption()
- {
- var path = Path.Combine(System.Environment.CurrentDirectory, "Configs/Option.json");
- var text = File.ReadAllText(path);
- Console.WriteLine($"Option Path:{path}");
- Console.WriteLine($"Option Text:{text}");
- var option = JsonConvert.DeserializeObject<Option>(text);
- return option;
- }
- }
- }
|