private void btnStartClick(object sender, EventArgs e) { var options = new OptionsDialog(); if (options.ShowDialog() == DialogResult.OK) { IPAddress ip = IPAddress.Parse(cbIp.SelectedItem.ToString()); int port = 2000; Difficulty = options.Difficulty; Category = options.Category; network = new NetworkServices(); network.ServerStarted += NetworkServerStarted; network.ServerStoped += NetworkServerStoped; network.GameStarted += NetworkGameStarted; network.ClientConnected += NetworkClientConnected; _ = network.Start(ip, port); } }