// Important Events private void clickView(object sender, EventArgs e) { int index = getSenderIndex(sender); m_parent.populateFields(Results[index].convertToPKM(Main.SAV), false); slotSelected = index; slotColor = Properties.Resources.slotView; FillPKXBoxes(SCR_Box.Value); L_Viewed.Text = string.Format(Viewed, Results[index].FileName); }
// Important Events private void clickView(object sender, EventArgs e) { sender = ((sender as ToolStripItem)?.Owner as ContextMenuStrip)?.SourceControl ?? sender as PictureBox; int index = Array.IndexOf(PKXBOXES, sender); var dataArr = Results.Skip(SCR_Box.Value * RES_MIN).Take(RES_MAX).ToArray(); if (index >= dataArr.Length) { System.Media.SystemSounds.Exclamation.Play(); } else { m_parent.populateFields(dataArr[index].convertToPKM(Main.SAV), false); slotSelected = index + SCR_Box.Value * RES_MIN; slotColor = Core.Properties.Resources.slotView; FillPKXBoxes(SCR_Box.Value); L_Viewed.Text = string.Format(Viewed, dataArr[index].FileName); } }
// Important Events private void clickView(object sender, EventArgs e) { sender = ((sender as ToolStripItem)?.Owner as ContextMenuStrip)?.SourceControl ?? sender as PictureBox; int index = Array.IndexOf(PKXBOXES, sender); if (index >= RES_MAX) { System.Media.SystemSounds.Exclamation.Play(); return; } index += SCR_Box.Value * RES_MIN; if (index >= Results.Count) { System.Media.SystemSounds.Exclamation.Play(); return; } m_parent.populateFields(Results[index], false); slotSelected = index; slotColor = Properties.Resources.slotView; FillPKXBoxes(SCR_Box.Value); L_Viewed.Text = string.Format(Viewed, Results[index].Identifier); }