public void MainWindow_Load(object sender, EventArgs e) { F12013Config2 config = new F12013Config2(); config.ReadConfig(); Authenticator auth = new Authenticator(); // New thread needed, or a loading screen. if (auth.ReadKey() == true) { // key has been found. get drivers with that key. if (auth.Key != "") { this.drivers = auth.GetDriverList(); if (this.drivers[0].ToString() != "") { this.UpdateDriverLabel(this.drivers[0].ToString()); } else { // No driver name returned. //this.UpdateAnonDriverLabel(); } } } else { // Failed to read auth key. } if (config.Safe == true) { this.stream = new UDPStream(config.Server, config.Port, this); } else { // Unable to succeed in reading the values from the config file. } Console.WriteLine("[GUI] Showing main window"); this.loading.Hide(); this.Show(); }
public ConvertForm(EncoderBuilder builder, string outputPath) { this.builder = builder; this.convertDel = new Action <Stream, Action <double> >(builder.StartEncode); Stream outputStream; if (outputPath.StartsWith("Multicast ")) { string[] param = outputPath.Substring(10).Split(':', ' '); outputStream = new UDPStream(System.Net.IPAddress.Parse(param[0]), System.Net.IPAddress.Parse(param[2]), int.Parse(param[3])); } else { outputStream = new FileStream(outputPath, FileMode.Create); } InitializeComponent(); this.cancelButton.Text = LanguageResource.Cancel; Text = LanguageResource.Converting; this.convertDel.BeginInvoke(outputStream, ProgressChange, new AsyncCallback(ConvertCallback), new object[] { outputStream, DateTime.Now }); }