private void FormMain_Load(object sender, EventArgs e)
        {
            try
            {
                ShowInTaskbar    = false;
                Visible          = false;
                Opacity          = 0;
                StartPosition    = System.Windows.Forms.FormStartPosition.Manual;
                Location         = new Point(-1000, -1000);
                notifyIcon1.Text = DriveService.Settings.Product + " " + DriveService.Settings.UserName + " on " +
                                   Environment.MachineName;

                foreach (MethodInfo methodInfo in DriveProxy.Service.Service.Methods)
                {
                    methodInfo.OnReceivedHwnd += methodInfo_OnReceivedHwnd;
                }

                _stateForm = new StateForm();

                _stateForm.Show();
                _stateForm.Visible = false;
                _stateForm.Hide();

                _logForm = new LogForm();

                _logForm.FormClosed += LogForm_FormClosed;

                _logForm.Visible = false;
                _logForm.Hide();

                StatusForm.Init();
                FeedbackForm.Init();

                if (_runTestCases)
                {
                    if (System.Windows.Forms.MessageBox.Show(this,
                                                             "Attempting to run test cases!",
                                                             Text,
                                                             MessageBoxButtons.OKCancel,
                                                             MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.OK)
                    {
                        _runTestCases = false;
                    }
                }

                _servicePipeServerThread = new System.Threading.Thread(ServicePipeServer_Process);

                _servicePipeServerThread.Start();
                Visible = false;
            }
            catch (Exception exception)
            {
                Log.Error(exception, false);
            }
        }
Exemple #2
0
        public static void Init()
        {
            try
            {
                if (_Instance == null)
                {
                    _Instance = new FeedbackForm();

                    _Instance.Show();
                }
            }
            catch (Exception exception)
            {
                Log.Error(exception, false);
            }
        }
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                _logForm.AllowClose = true;

                _logForm.Close();

                _stateForm.AllowClose = true;

                _stateForm.Close();

                StatusForm.Close();
                FeedbackForm.Close();

                notifyIcon1.Visible = false;

                try
                {
                    if (_servicePipeServerThread != null)
                    {
                        ServicePipeClient.CloseServer();

                        for (int i = 0; i < 1; i++)
                        {
                            if (_servicePipeServerThread == null)
                            {
                                break;
                            }

                            System.Threading.Thread.Sleep(100);
                        }
                    }
                }
                catch
                {
                }

                DriveService.StopBackgroundProcesses(true);
            }
            catch (Exception exception)
            {
                Log.Error(exception, false);
            }
        }
        public static void Init()
        {
            try
              {
            if (_Instance == null)
            {
              _Instance = new FeedbackForm();

              _Instance.Show();
            }
              }
              catch (Exception exception)
              {
            Log.Error(exception, false);
              }
        }