Exemplo n.º 1
0
 public void CloseForm()
 {
     if (_server != null)
     {
         _server.Dispose();
         _server = null;
     }
     process.Close();
     this.Close();
 }
Exemplo n.º 2
0
        private void HandleProcessExited()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new Action(HandleProcessExited));
                return;
            }

            if (_server != null)
            {
                _server.Dispose();
                _server = null;
            }
            UpdateToolStripMenuItemState();

            timerBlink.Stop();
            _iconIndex      = 0;
            notifyIcon.Icon = _icons[_iconIndex];
        }
Exemplo n.º 3
0
        public void StartSynchronizing()
        {
            var startInfo = new ProcessStartInfo();

            startInfo.FileName               = GetSyncExePathName();
            startInfo.Arguments              = SYNC_EXE_OPTION_SYNCHRONIZE;
            startInfo.UseShellExecute        = false;
            startInfo.CreateNoWindow         = true;
            startInfo.RedirectStandardOutput = true;
            startInfo.RedirectStandardInput  = true;
            process.StartInfo = startInfo;
            var r = process.Start();

            if (r)
            {
                var stdout = process.StandardOutput.BaseStream;
                var stdin  = process.StandardInput.BaseStream;
                _server = new GOCalendarSyncCommon.Server(stdout, stdin, server_HandlePacket);
                _server.Start();
                timerBlink.Start();
            }
            UpdateToolStripMenuItemState();
        }