static void Main(string[] parameters)
        {
            var config = Config.Instance;

            if (parameters.Contains("-r"))
            {
                config.LastChoiceValid = DateTime.Now.AddMinutes(-1);
                config.Save();
                return;
            }

            bool toolExecuted = false;

            if (DateTime.Now < config.LastChoiceValid)
            {
                config.LastChoiceValid = DateTime.Now.AddMinutes(config.LastChoiceDuration);
                config.Save();

                var ti = config.LastChoiceToolIndex;
                var tp = config.ToolParameters[ti];

                toolExecuted = true;
                ToolExecutionManager.ExecuteTool(tp, parameters);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new AppForm(!toolExecuted));
        }
Пример #2
0
        private void Execute(ToolParameters tp)
        {
            if (chRememberChoice.Checked)
            {
                var config = Config.Instance;
                config.LastChoiceToolIndex = lvTools.SelectedIndices[0];
                config.LastChoiceDuration  = 100;
                config.LastChoiceValid     = DateTime.Now.AddMinutes(config.LastChoiceDuration);
                config.Save();
            }

            ToolExecutionManager.ExecuteTool(tp, _parameters);

            Close();
        }