private void UpdateControlListElement(ListViewItem Item, int Index, bool ResizeColumns) {
Interface.CommandInfo Info;
Interface.TryGetCommandInfo(Interface.CurrentControls[Index].Command, out Info);
Item.SubItems[0].Text = Info.Name;
switch (Info.Type) {
case Interface.CommandType.Digital: Item.SubItems[1].Text = Interface.GetInterfaceString("controls_list_type_digital"); break;
case Interface.CommandType.AnalogHalf: Item.SubItems[1].Text = Interface.GetInterfaceString("controls_list_type_analoghalf"); break;
case Interface.CommandType.AnalogFull: Item.SubItems[1].Text = Interface.GetInterfaceString("controls_list_type_analogfull"); break;
default: Item.SubItems[1].Text = Info.Type.ToString(); break;
}
Item.SubItems[2].Text = Info.Description;
if (Interface.CurrentControls[Index].Method == Interface.ControlMethod.Keyboard) {
Item.ImageKey = "keyboard";
} else if (Interface.CurrentControls[Index].Method == Interface.ControlMethod.Joystick) {
if (Info.Type == Interface.CommandType.AnalogHalf | Info.Type == Interface.CommandType.AnalogFull) {
Item.ImageKey = "joystick";
} else {
Item.ImageKey = "gamepad";
}
} else {
Item.ImageKey = null;
}
Item.SubItems[3].Text = GetControlDetails(Index);
if (ResizeColumns) {
listviewControls.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
}
}