示例#1
0
文件: Program.cs 项目: withlin/c-raft
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 private static void Main(string[] args)
 {
     Environment.CurrentDirectory = Path.GetDirectoryName(MainService.IsRunningInMono ? GetExecutablePath() : typeof(Program).Assembly.Location);
     //Install command-line argument
     if (args.Any(a => a.Equals("-install", StringComparison.InvariantCultureIgnoreCase)))
     {
         InstallService(args);
     }
     else if (args.Any(a => a.Equals("-uninstall", StringComparison.InvariantCultureIgnoreCase)))
     {
         UninstallService(args);
     }
     else if (args.Any(a => new[] { "/?", "-?", "/help" }.Any(helpArg => helpArg.Equals(a, StringComparison.InvariantCultureIgnoreCase))))
     {
         ShowUsage();
     }
     else
     {
         var svc = new MainService();
         svc.Run(args);
     }
 }
示例#2
0
文件: Program.cs 项目: TheaP/c-raft
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 private static void Main(string[] args)
 {
     Environment.CurrentDirectory = Path.GetDirectoryName(MainService.IsRunningInMono ? GetExecutablePath() : typeof (Program).Assembly.Location);
     //Install command-line argument
     if (args.Any(a => a.Equals("-install", StringComparison.InvariantCultureIgnoreCase)))
     {
         InstallService(args);
     }
     else if (args.Any(a => a.Equals("-uninstall", StringComparison.InvariantCultureIgnoreCase)))
     {
         UninstallService(args);
     }
     else if (args.Any(a => new[] { "/?", "-?", "/help" }.Any(helpArg => helpArg.Equals(a, StringComparison.InvariantCultureIgnoreCase))))
     {
         ShowUsage();
     }
     else
     {
         var svc = new MainService();
         svc.Run(args);
     }
 }