private void configurationToolStripMenuItem_Click(object sender, EventArgs e) { _configD.safeInvoke(() => { if (_configD.CanFocus) { _configD.Activate(); } else { _configD = new ConfigurationDialog(_configuration); Thread t = new Thread(() => { if (_configD.ShowDialog() == DialogResult.OK) { _configuration.save(); } }); t.SetApartmentState(ApartmentState.STA); t.IsBackground = true; t.Start(); } }); }
public Main() { InitializeComponent(); _configuration = new Config(Application.StartupPath + @"\Settings.ini"); _configD = new ConfigurationDialog(_configuration); _clientBuilderD = new ClientBuilderDialog(); _pluginsD = new PluginsDialog(); _upnpD = new UPnPDialog(); _fileTransfersD = new FileTransfersDialog(); _logD = new LogDialog(); _newsD = new NewsDialog(); _aboutD = new AboutDialog(); _listening = false; _listeners = new Dictionary <int, TcpListener>(); _dataSent = 0; _dataReceived = 0; _rsa = new RSACryptoServiceProvider(2048); _connectedUsers = 0; }