public static void Main(string[] args)
        {
            // new instance
            Instance = new TangramLectorTaskManager();

            // default for no given tangram lector PID
            Instance.TangramLectorProcessID = -1;

            // try to parse arguments to get PID
            if (args != null)
            {
                string arg = String.Empty;
                for (int i = 0; i < args.Length; i++)
                {
                    arg = args[i];
                    if (arg.ToLower().Equals("-pid") && i < args.Length - 1)
                    {
                        try { Instance.TangramLectorProcessID = int.Parse(args[i + 1]); }
                        catch (FormatException) { }
                        catch (OverflowException) { }
                    }
                }
            }
            if (Instance.TangramLectorProcessID>=0)
            {
                // run user interface loop 
                Application.Run(Instance);
            }
            else
            {
                Instance.checkRunningTangramLectorTimer.Stop();
                Instance.exitThis(ErrorCodes.NO_PID);
            }
        }
Example #2
0
        public static void Main(string[] args)
        {
            // new instance
            Instance = new TangramLectorTaskManager();

            // default for no given tangram lector PID
            Instance.TangramLectorProcessID = -1;

            // try to parse arguments to get PID
            if (args != null)
            {
                string arg = String.Empty;
                for (int i = 0; i < args.Length; i++)
                {
                    arg = args[i];
                    if (arg.ToLower().Equals("-pid") && i < args.Length - 1)
                    {
                        try { Instance.TangramLectorProcessID = int.Parse(args[i + 1]); }
                        catch (FormatException) { }
                        catch (OverflowException) { }
                    }
                }
            }
            if (Instance.TangramLectorProcessID >= 0)
            {
                // run user interface loop
                Application.Run(Instance);
            }
            else
            {
                Instance.checkRunningTangramLectorTimer.Stop();
                Instance.exitThis(ErrorCodes.NO_PID);
            }
        }