System.Collections.ArrayList.ArrayListAdapter.LastIndexOf C# (CSharp) Méthode

LastIndexOf() public méthode

public LastIndexOf ( object value, int startIndex, int count ) : int
value object
startIndex int
count int
Résultat int
			public override int LastIndexOf(object value, int startIndex, int count) 
			{
				if (startIndex < 0) 
				{
					ThrowNewArgumentOutOfRangeException ("startIndex", startIndex, "< 0");
				}

				if (count < 0) 
				{
					ThrowNewArgumentOutOfRangeException ("count", count, "count is negative.");
				}

				if (startIndex - count  + 1 < 0) 
				{
					ThrowNewArgumentOutOfRangeException ("count", count, "count is too large.");
				}

				if (value == null) 
				{
					for (int i = startIndex; i > startIndex - count; i--) 
					{
						if (m_Adaptee[i] == null) 
						{
							return i;
						}
					}
				}
				else 
				{
					for (int i = startIndex; i > startIndex - count; i--) 
					{
						if (value.Equals(m_Adaptee[i])) 
						{
							return i;
						}
					}
				}

				return -1;
			}

Same methods

ArrayList.ArrayListAdapter::LastIndexOf ( object value ) : int
ArrayList.ArrayListAdapter::LastIndexOf ( object value, int startIndex ) : int