aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.DispenserAnalyzer.UI/App.xaml.cs
blob: f3bce6c999a0fd961ad27bb705c9f440fb3b3414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;

namespace Tango.DispenserAnalyzer.UI
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            MainWindow wnd = new MainWindow();

            string[] args = null;
            if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null)
            {
                string[] inputArgs = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData;

                if (inputArgs != null && inputArgs.Length > 0)
                {
                    char[] spearator = { ','};
                    args = inputArgs[0].Split(spearator);
                }
            }
            else if (e.Args.Length > 0)
            {
                char[] spearator = { ',' };
                args = e.Args[0].Split(spearator);
            }
            if(args != null && args.Length > 0)
            {
                //MessageBox.Show("Before generate" + String.Join(" ", args));
                wnd.GenerateResultsInBackground(args);
            }
            else
            {
                wnd.Show();
            }
        }
    }
}