System.Collections.Generic.List.IndexOf(Widget)

Here are the examples of the csharp api System.Collections.Generic.List.IndexOf(Widget) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 Source : WidgetInput.cs
with GNU General Public License v3.0
from mrojkov

public void Remove(Widget widget)
			{
				var i = stack.IndexOf(widget);
				if (i >= 0) {
					stack.RemoveAt(i);
				}
				RefreshTop();
			}

19 Source : KeyboardFocus.cs
with GNU General Public License v3.0
from mrojkov

private void AdvanceFocus(int direction)
		{
			if (!CanRegainFocus()) {
				var focused = GetFirstFocusable() ?? Widget;
				Widget.SetFocus(focused);
			} else if (Widget.Focused == Widget) {
				lastFocused.SetFocus();
			} else {
				var traversables = GetTabTraversables(Widget).ToList();
				if (traversables.Count > 0) {
					var i = traversables.IndexOf(lastFocused);
					i = (i < 0) ? 0 : Mathf.Wrap(i + direction, 0, traversables.Count - 1);
					traversables[i].SetFocus();
				}
			}
		}