/// <summary>Loads the local variable at index i onto the evaluation stack.</summary> public static ILSugar LoadVariable(this ILSugar il, int i) { switch (i) { case 0: il.Ldloc_0(); break; case 1: il.Ldloc_1(); break; case 2: il.Ldloc_2(); break; case 3: il.Ldloc_3(); break; default: if (i <= byte.MaxValue) { il.Ldloc_S((byte)i); } else { il.Ldloc(i); } break; } return(il); }