public void Save(TcpForwarderSettings settings) { try { using (var file = File.OpenWrite(this.fullPath)) { this.ser.Serialize(file, settings); } } catch { } }
protected override void OnClosing(CancelEventArgs e) { this.Stop(); var settings = new TcpForwarderSettings(); settings.SourcePort = this.textBoxSourcePort.Text; settings.TargetIP = this.textBoxTargetIP.Text; settings.TargetPort = this.textBoxTargetPort.Text; this.tempSettingsManager.Save(settings); base.OnClosing(e); }