Castle.Facilities.NHibernateIntegration.Util.FieldInfoCollection.IndexOfKey C# (CSharp) Метод

IndexOfKey() публичный Метод

Returns the zero-based index of the first occurrence of the specified MemberInfo.Name value in the FieldInfoCollection.
IndexOfKey is similar to IndexOf but compares the specified key to the value of the MemberInfo.Name property of each FieldInfo element, rather than to the element itself.
public IndexOfKey ( string key ) : int
key string /// The value /// to locate in the . /// This argument may be a null reference. ///
Результат int
		public int IndexOfKey(string key)
		{
			int count = _data.Count;
			FieldInfo[] items = _data.Items;

			for (int i = 0; i < count; i++)
			{
				if (items[i] == null)
					continue;

				if (key == null)
				{
					if ((object) items[i].Name == null)
						return i;
					continue;
				}

				if (key.Equals(items[i].Name))
					return i;
			}

			return -1;
		}