예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            string notifyText = DriveService.Settings.Product + " " + DriveService.Settings.UserName + " on " +
                            Environment.MachineName;
            if (notifyText.Length > 63)
            {
              notifyIcon1.Text = notifyText.Substring(0, 60) + "...";
            }
            else
            {
              notifyIcon1.Text = notifyText;
            }

            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);
              }
        }