public static char GetFieldSymbol(TestTargetClass target, int index) { try { if (index < target.classField2.Length) { return(target.classField2[index]); } return('\n'); } finally { } }
static void Main(string[] args) { List <TestTargetClass> targetsList = new List <TestTargetClass>() { new TestTargetClass(), new TestTargetClass(15, "stringParam") }; for (int i = 0; i < targetsList.Count; i++) { int temp = 10 + i * 20; targetsList[i].SetFields(ref temp, "newStringParam" + i); targetsList[i].GetFields(); TestTargetClass.GetFieldSymbol(targetsList[i], i * 20); } }