I created a static method that takes an array and a new value (sometimes I pass a string separated by commas and separate it, sometimes I pass the argument "params", etc.).
Using this method, you can call this method in the debug window or in the nearest window. For example, you can call "SetArrayOne ()" anytime you need to pre-set values, or you can call "SetArray (...)" and pass the arguments you need:
byte[] myClassLevelArray1 = new byte[10]; byte[] myClassLevelArray2 = new byte[10]; public void SetArrayOne() { SetArray(myClassLevelArray1, 1, 2, 3, 4, 5); } public void SetArrayTwo() { SetArray(myClassLevelArray2, 1, 2, 3, 4, 5, 8, 9, 10, 11, 15, 20, 5, 98, 5, 4); } public static void SetArray(byte[] myArray, params byte[] newValues) { Array.Copy(newValues, myArray, Math.Min(newValues.Length, myArray.Length)); }
source share