public void CloseForm() { if (_server != null) { _server.Dispose(); _server = null; } process.Close(); this.Close(); }
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]; }
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(); }