Пример #1
0
        static StackObject *Equals_26(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object @obj = (System.Object) typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Reflection.FieldInfo instance_of_this_method = (System.Reflection.FieldInfo) typeof(System.Reflection.FieldInfo).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Equals(@obj);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
		/// <summary>
		/// Returns the zero-based index of the first occurrence
		/// of the specified <see cref="FieldInfo"/> in the
		/// <see cref="FieldInfoCollection"/>.
		/// </summary>
		/// <param name="value">
		/// The <see cref="FieldInfo"/> object
		/// to locate in the <see cref="FieldInfoCollection"/>.
		/// This argument may be a null reference.
		/// </param>
		/// <returns>
		/// The zero-based index of the first occurrence of
		/// <paramref name="value"/> in the <see cref="FieldInfoCollection"/>,
		/// if found; otherwise, -1.</returns>
		/// <remarks>
		/// Please refer to <see cref="ArrayList.IndexOf(object)"/> for details.
		/// </remarks>
		public int IndexOf(FieldInfo value)
		{
			int count = _data.Count;
			FieldInfo[] items = _data.Items;

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

				return -1;
			}

			for (int i = 0; i < count; i++)
			{
				if (value.Equals(items[i]))
					return i;
			}

			return -1;
		}