private void MainForm_Load(object sender, EventArgs e) { comboBoxRotation.SelectedIndex = 0; comboBoxFlipping.SelectedIndex = 0; comboBoxEnvironment.DataSource = Level.EnvironmentsNames; ClipboardNotification.ClipboardUpdate += ClipboardNotification_ClipboardUpdate; ClipboardNotification_ClipboardUpdate(null, EventArgs.Empty); foreach (Control ctrl in panelAllowedBlocks.Controls) { ((CheckBox)ctrl).CheckedChanged += new EventHandler(checkBoxBlocks_CheckedChanged); } LevelsManager = new LevelsManager(LevelsManager.SteamUsers().FirstOrDefault()); LoadLevels(); BlockInfosManager = new BlockInfosManager(); formBlockReference = new FormBlockReference(); formBlockReference.Owner = this; formAxisHelp = new FormAxisHelp(); formImageConverter = new FormColors(); formImageConverter.Owner = this; formScripting = new FormScripting(); formScripting.Owner = this; }
private void LoadLevels() { listViewLevels.Items.Clear(); statusProgressbar.Maximum = LevelsManager.CountLevels(); statusProgressbar.Value = 0; backgroundWorkerLoadLevels.RunWorkerAsync(); }
private void backgroundWorkerLoadLevels_DoWork(object sender, DoWorkEventArgs e) { foreach (Level lvl in LevelsManager.GetLevels()) { ListViewItem item = lvl.ListViewItem; item.Group = listViewLevels.Groups[(int)lvl.Source]; backgroundWorkerLoadLevels.ReportProgress(0, item); } }
private void buttonReloadLevels_Click(object sender, EventArgs e) { buttonReloadLevels.Enabled = false; LevelsManager.ClearLoadedLevels(); LoadLevels(); }