Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            // redirect console output to parent process;
            // must be before any calls to Console.WriteLine()
            AttachConsole(AttachParentProcess);

            if (args.Length > 0)
            {
                try
                {
                    var arguments = CommandLine.Parse<InputArguments>();
                    ISteps ladder = new Steps();
                    ladder.LogEnabled = arguments.EnableLog;
                    ladder.TotalFlow(new FileInfo(arguments.TargetFile));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    Console.ReadKey();
                }

                // sending the enter key is not really needed, but otherwise the user thinks the app is still running by looking at the commandline. The enter key takes care of displaying the prompt again.
                SendKeys.SendWait("{ENTER}");
                Application.Exit();
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }
Exemplo n.º 2
0
        private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            ISteps ladder = new Steps();
            ladder.LogFolder = new DirectoryInfo(textBox_workfolder.Text);
            ladder.LogEnabled = checkBox_log.Checked;
            var step = (int)e.Argument;
            if (step == 1)
            {
              int sidst = ladder.GetDaisyXML(new FileInfo(textBox_workfolder.Text + @"\dataextract"), Convert.ToInt16(textBox_sidsthentet.Text));
              ApexSettings.UpdateApexSetting("sidsthentet", sidst.ToString());
            }
            if (step == 2)
            {
                ladder.TransformDaisy2APEX(new DirectoryInfo(textBox_workfolder.Text), new DirectoryInfo(textBox_outputfolder.Text));

            }
            if (step == 3)
                ladder.ValidateAPEXFile(new FileInfo(textBox_outputfolder.Text + @"\" + textBox_sidsthentet.Text));

            if (step == 4)
             PackFiles();
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     ISteps ladder = new Steps();
     ladder.LogEnabled = checkBox1.Checked;
     ladder.TotalFlow(new FileInfo(textBox1.Text));
 }