Castle.Facilities.NHibernateIntegration.Util.FieldInfoCollection.Add C# (CSharp) Method

Add() public method

Adds a FieldInfo to the end of the FieldInfoCollection.
Please refer to ArrayList.Add for details.
/// The /// is read-only or has a fixed size. /// -or- /// The FieldInfoCollection /// already contains , /// and the FieldInfoCollection /// ensures that all elements are unique.
public Add ( FieldInfo value ) : int
value System.Reflection.FieldInfo /// The object to be added /// to the end of the . /// This argument may be a null reference. ///
return int
		public virtual int Add(FieldInfo value)
		{
			if (_data.IsUnique) CheckUnique(value);

			int count = _data.Count;
			if (count == _data.Items.Length)
				_data.EnsureCapacity(count + 1);

			_data.Items[count] = value;
			return _data.Count++;
		}

Usage Example

コード例 #1
0
ファイル: ReflectionUtil.cs プロジェクト: RookieX/Windsor
		/// <summary>
		/// Gets all the fields WITHOUT ANY of the specified attributes.
		/// </summary>
		public static FieldInfoCollection GetFieldsWithOutAttributes(Type type, params Type[] types)
		{
			FieldInfoCollection fields = new FieldInfoCollection();

			bool match;
			foreach (FieldInfo field in type.GetFields())
			{
				match = true;
				foreach (Type attType in types)
				{
					if (field.GetCustomAttributes(attType, true).Length != 0)
						match = false;
				}
				if (match)
					fields.Add(field);
			}

			return fields;
		}
All Usage Examples Of Castle.Facilities.NHibernateIntegration.Util.FieldInfoCollection::Add