I am currently using this in my C# code:
numArray = (int[])Utils.CopyArray(numArray, new int[num3 + 1]);
I would like to switch to Array.Copy but can't figure out how without making errors (index out of range, etc).
UPDATED CODE TO SHOW MORE DEPTH
var num3 = 0;
int[] numArray = { };
var mediafileName = @"";
for (var j = 0; j <= PlayListGrid.Rows.Count - 1; j++)
{
if (!Equals(Convert.ToString(PlayListGrid.Rows[j].Cells["Song"].Value), @""))
{
num3++;
numArray = (int[])Utils.CopyArray(numArray, new int[num3 + 1]);
numArray[num3] = j;
}
else
{
mediafileName = Convert.ToString(PlayListGrid.Rows[j].Cells["MediaFileName"].Value);
}
table.Rows.Add((j + 1).ToString(), @"",
Convert.ToString(PlayListGrid.Rows[j].Cells["Artist"].Value),
Convert.ToString(PlayListGrid.Rows[j].Cells["Title"].Value),
Convert.ToString(PlayListGrid.Rows[j].Cells["DiscId"].Value),
mediafileName,
Convert.ToString(PlayListGrid.Rows[j].Cells["Time"].Value),
Convert.ToString(PlayListGrid.Rows[j].Cells["TimeLengthSecs"].Value));
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…