private void trackBar1_Scroll(object sender, EventArgs e) { if (_dGetSpeed != null) { _dGetSpeed.Invoke(trackBar1.Value); } }
//using delegate to transfer animation speed to main form private void UI_tbarAni_Scroll(object sender, EventArgs e) { if (aniSpeed != null) { aniSpeed.Invoke((int)UI_tbarAni.Value); } }
/// <summary> /// Sends selected item(s) back to Main /// </summary> private void Btn_Add_Click(object sender, EventArgs e) { if (lvFound.SelectedItems.Count == 0) { return; } Cursor = Cursors.WaitCursor; int[] irmList = new int[lvFound.SelectedItems.Count]; int[] irmView = new int[lvFound.SelectedItems.Count]; SQL.BeginTransaction(); for (int i = 0; i < lvFound.SelectedItems.Count; i++) { //save entry and remove from list int iPos = int.Parse(lvFound.SelectedItems[i].ImageKey); int iMangaID = SQL.SaveManga(lFound[iPos].Artist, lFound[iPos].Title, lFound[iPos].PostedDate, lFound[iPos].Tags, lFound[iPos].Location, lFound[iPos].PageCount, -1, lFound[iPos].Category, lFound[iPos].Rating, ""); if (delAddedManga != null) { delAddedManga.Invoke(iMangaID); } irmView[i] = lvFound.SelectedItems[i].Index; irmList[i] = iPos; } SQL.CommitTransaction(); Array.Sort(irmList); Array.Sort(irmView); lvFound.BeginUpdate(); for (int i = lvFound.SelectedItems.Count - 1; i > -1; i--) { lvFound.Items.RemoveAt(irmView[i]); lFound.RemoveAt(irmList[i]); } lvFound.EndUpdate(); if (delNewEntry != null) { delNewEntry.Invoke(true); } Cursor = Cursors.Default; }