PKHeX.SAV_Pokepuff.B_Sort_Click C# (CSharp) Method

B_Sort_Click() private method

private B_Sort_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void B_Sort_Click(object sender, EventArgs e)
        {
            byte[] puffarray = new byte[100];
            if (ModifierKeys == Keys.Control)
            {
                for (int i = 0; i < 100; i++)
                {
                    string puff = dataGridView1.Rows[i].Cells[1].Value.ToString();
                    puffarray[i] = (byte) Array.IndexOf(pfa, puff);
                }
                Array.Sort(puffarray);
                Array.Reverse(puffarray);
            }
            else
            {
                int count = 0;
                for (int i = 0; i < 100; i++)
                {
                    string puff = dataGridView1.Rows[i].Cells[1].Value.ToString();
                    byte puffval = (byte) Array.IndexOf(pfa, puff);
                    if (puffval == 0) continue;
                    puffarray[count] = puffval;
                    count++;
                }
                Array.Resize(ref puffarray, count);
                Array.Sort(puffarray);
                Array.Resize(ref puffarray, 100);
            }
            Array.Copy(puffarray, 0, sav, 0x5400 + savindex*0x7F000, 100);
            Setup();
        }
        private void B_Save_Click(object sender, EventArgs e)