コード例 #1
0
		/// <summary>
		/// Add the new result to the collection
		/// </summary>
		/// <param name="result">The result to be collected</param>
		/// <returns>The index position it was added to.</returns>
		public int Add(LdapSearchResult result)
		{
			int idx = -1;
			idx = List.Add(result);
			if ( OnNew != null )
			{
				LdapSearchResultCollectionEventArgs args = new LdapSearchResultCollectionEventArgs(result, SmartChangeType.New);
				OnNew(this, args);
			}			
			return idx;
		}
コード例 #2
0
		/// <summary>
		/// Remove the specified column
		/// </summary>
		/// <param name="value">Column to be removed</param>
		public void Remove( LdapSearchResult value )  
		{
			List.Remove( value );
			if ( OnRemoved != null )
			{
				LdapSearchResultCollectionEventArgs args = new LdapSearchResultCollectionEventArgs(value, SmartChangeType.Removed);
				OnRemoved(this, args);
			}
		}
コード例 #3
0
		/// <summary>
		/// Insert the Search Result at the specified position
		/// </summary>
		/// <param name="index">Index position</param>
		/// <param name="value">The Search Result to insearch</param>
		public void Insert( int index, LdapSearchResult value )  
		{
			List.Insert( index, value );
			if ( OnInserted != null )
			{
				LdapSearchResultCollectionEventArgs args = new LdapSearchResultCollectionEventArgs(value, SmartChangeType.New);
				OnInserted(this, args);
			}
		}
コード例 #4
0
		/// <summary>
		/// Remove the specified column using the name provided
		/// </summary>
		/// <param name="name">Name to remove</param>
		public void Remove( string name )
		{
			int idx = IndexOf(name);
			if ( idx > -1 )
			{
				LdapSearchResult sc = this[name];
				List.RemoveAt(idx);
				if ( OnRemoved != null )
				{
					LdapSearchResultCollectionEventArgs args = new LdapSearchResultCollectionEventArgs(sc, SmartChangeType.Removed);
					OnRemoved(this, args);
				}
			}
		}