/// <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; }
/// <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); } }
/// <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); } }
/// <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); } } }