static void Main(string[] args)
        {
            bool createdNew = true;

            using (Mutex mutex = new Mutex(true, "CyBLEMTKApplication", out createdNew))
            {
                if (createdNew)
                {
                    //Console.WriteLine("Number of command line parameters = {0}", args.Length);
                    foreach (string s in args)
                    {
                        check_argument(s);
                    }
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    CyBLE_MTK MTK_application = new CyBLE_MTK();

                    if (args.Length > 0)
                    {
                        if (!check_argument(args[args.Length - 1]))
                        {
                            MTK_application.LoadTest(true, args[args.Length - 1]);
                        }
                    }
                    //if (run_in_background)
                    //{
                    //    MTK_application
                    //}
                    //else



                    Application.Run(MTK_application);
                }
                else
                {
                    Process current = Process.GetCurrentProcess();
                    foreach (Process process in Process.GetProcessesByName(current.ProcessName))
                    {
                        if (process.Id != current.Id)
                        {
                            SetForegroundWindow(process.MainWindowHandle);
                            break;
                        }
                    }
                }
            }
        }
 public PreferencesDialog(CyBLE_MTK Parent, LogManager Logger) : this()
 {
     Log      = Logger;
     MainForm = Parent;
     this.ChangePasswordButton.Click += new EventHandler(MainForm.ChangePasswordButton_Click);
 }