private void PopulateFontNames () { OptionsDialog.BuildFontList(this.CreateGraphics()); //if (OptionsDialog.FontList == null) //{ // worker = new Thread(new ThreadStart(DiscoverFontNames)); // worker.IsBackground = true; // worker.Start(); //} //else //{ // PopulateFontNamesCompleted(); //} }
private void PopulateFontNames() { OptionsDialog.BuildFontList(this.CreateGraphics()); PopulateFontNamesCompleted(); //if (OptionsDialog.FontList == null) //{ // worker = new BackgroundWorker(); // worker.DoWork += new DoWorkEventHandler(DiscoverFontNames); // worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(PopulateFontNamesCompleted); // worker.RunWorkerAsync(); //} //else //{ // familyBox.Items.AddRange(OptionsDialog.FontList.ToArray()); // familyBox.SelectedIndex = 0; // familyBox.Enabled = true; //} }
private void DiscoverFontNames(object sender, DoWorkEventArgs e) { OptionsDialog.BuildFontList(this.CreateGraphics()); //this.Invoke(... }
private void DiscoverFontNames () { OptionsDialog.BuildFontList(this.CreateGraphics()); this.Invoke(new MethodInvoker(PopulateFontNamesCompleted)); }