예제 #1
0
 private static void RunOnExit(AppArguments args)
 {
     //try
     //{
     //    Log.Information("{User} closed {Exe}", args.UserName, args.ExeName);
     //    Log.CloseAndFlush();
     //}
     //catch { }
 }
예제 #2
0
 private static void SafeExecute(Action <AppArguments> action, AppArguments args)
 {
     try
     {
         action.Invoke(args);
     }
     catch (Exception ex)
     {
         //Log.Error(ex.Info(true, true));
         Alert.Show(ex, "Initialize -> SafeExecute");
         CurrentExe.Shutdown();
     }
 }
예제 #3
0
        public static AppArguments Parse()
        {
            var args    = new AppArguments();
            var options = new OptionSet
            {
                { "db|database=", "Database file path", db => args.DbFilePath = db },
                { "exe|origexe=", "Original CRUD exe", exe => args.OrigCrudExe = exe },
                { "key|publickey=", "Public key", key => args.SetCredentials(key) }
            };

            try
            {
                options.Parse(Environment.GetCommandLineArgs());
                args.InitializeDatabases();
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
            return(args);
        }