public static bool PrintAll(this Commands commands) { for (int i = 0; i <= commands.Count; i++) { var command = commands.Item(i); if (command != null) { Console.WriteLine($"Command #: {i} Type: {command.Type}"); foreach (ENUM_FIELD_TYPES enumFieldType in Enum.GetValues(typeof(ENUM_FIELD_TYPES))) { try { var typeIndex = 0; var cmdText = command.GetText(enumFieldType, typeIndex); var prevCmdText = ""; // Loop while cmdText is not null or empty and different from the previous value while (!string.IsNullOrEmpty(cmdText) && cmdText != prevCmdText) { if (typeIndex > 0) { Console.WriteLine($" index: {typeIndex}"); } Console.WriteLine($" {enumFieldType}: {cmdText}"); // Save the current cmdText as the previous value, increment typeIndex and get the next cmdText prevCmdText = cmdText; typeIndex++; cmdText = command.GetText(enumFieldType, typeIndex); } } catch { Console.WriteLine($"\n\n\n***GetText Failed*** Enum: {enumFieldType}\n\n\n"); } } } } return false; }