private void btnKes_Click(object sender, EventArgs e) { if (SeriPort.IsOpen == true) { SeriPort.Close(); } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { if (SeriPort.IsOpen == true) { SeriPort.Close(); } }
public void PortKapat() { StopWatch.Stop(); SeriPort.Close(); SeriPortKapandi?.Invoke(SeriPort, EventArgs.Empty); }