コード例 #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 LogForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     try
     {
         _logForm = null;
     }
     catch (Exception exception)
     {
         Log.Error(exception, false);
     }
 }
コード例 #3
0
        private void toolStripMenuItemShowLog_Click(object sender, EventArgs e)
        {
            try
            {
                if (_logForm == null)
                {
                    _logForm = new LogForm();
                }

                _logForm.Visible = true;
                _logForm.Show();
            }
            catch (Exception exception)
            {
                Log.Error(exception, false);
            }
        }
コード例 #4
0
        private void toolStripMenuItemShowLog_Click(object sender, EventArgs e)
        {
            try
              {
            if (_logForm == null)
            {
              _logForm = new LogForm();
            }

            _logForm.Visible = true;
            _logForm.Show();
              }
              catch (Exception exception)
              {
            Log.Error(exception, false);
              }
        }
コード例 #5
0
 private void LogForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     try
       {
     _logForm = null;
       }
       catch (Exception exception)
       {
     Log.Error(exception, false);
       }
 }
コード例 #6
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);
              }
        }