private int DoListColumn(ListViewState listView, List<ColumnViewElement> columnViewElements, int columnIndex, int selectedIndex, ObjectColumnFunction selectedSearchItemFunction, ObjectColumnFunction selectedRegularItemFunction, ObjectColumnGetDataFunction getDataForDraggingFunction)
{
if (((Event.current.type == EventType.KeyDown) && (Event.current.keyCode == KeyCode.Return)) && (listView.row > -1))
{
if (this.isSearching && (selectedSearchItemFunction != null))
{
this.DoSearchItemSelectedEvent(selectedSearchItemFunction, columnViewElements[selectedIndex].value);
}
if ((!this.isSearching && (GUIUtility.keyboardControl == listView.ID)) && (selectedRegularItemFunction != null))
{
DoItemSelectedEvent(selectedRegularItemFunction, columnViewElements[selectedIndex].value);
}
}
if (((GUIUtility.keyboardControl == listView.ID) && (Event.current.type == EventType.KeyDown)) && !this.isSearching)
{
switch (Event.current.keyCode)
{
case KeyCode.LeftArrow:
this.m_ColumnToFocusKeyboard = columnIndex - 1;
Event.current.Use();
break;
case KeyCode.RightArrow:
this.m_ColumnToFocusKeyboard = columnIndex + 1;
Event.current.Use();
break;
}
}
GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(this.columnWidth) };
IEnumerator enumerator = ListViewGUILayout.ListView(listView, s_Styles.background, options).GetEnumerator();
try
{
while (enumerator.MoveNext())
{
ListViewElement current = (ListViewElement) enumerator.Current;
ColumnViewElement columnViewElement = columnViewElements[current.row];
if ((current.row == listView.row) && (Event.current.type == EventType.Repaint))
{
Rect position = current.position;
position.x++;
position.y++;
s_Styles.selected.Draw(position, false, true, true, GUIUtility.keyboardControl == listView.ID);
}
GUILayout.Label(columnViewElement.name, new GUILayoutOption[0]);
if (columnViewElement.value is List<ColumnViewElement>)
{
Rect rect2 = current.position;
rect2.x = (rect2.xMax - s_Styles.categoryArrowIcon.width) - 5f;
rect2.y += 2f;
GUI.Label(rect2, s_Styles.categoryArrowIcon);
}
this.DoDoubleClick(current, columnViewElement, selectedSearchItemFunction, selectedRegularItemFunction);
DoDragAndDrop(listView, current, columnViewElements, getDataForDraggingFunction);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
if (Event.current.type == EventType.Layout)
{
selectedIndex = listView.row;
}
return selectedIndex;
}