Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 841ec34ec4
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (47 sloc) 1.633 kb
using System;
using System.Collections;
namespace Mercury
{
public class SearchResults : CollectionBase {
public SearchResult this[ int index ] {
get {
return( (SearchResult) List[index] );
}
set {
List[index] = value;
}
}
public int Add( SearchResult value ) {
return( List.Add( value ) );
}
public int IndexOf( SearchResult value ) {
return( List.IndexOf( value ) );
}
public void Insert( int index, SearchResult value ) {
List.Insert( index, value );
}
public void Remove( SearchResult value ) {
List.Remove( value );
}
public bool Contains( SearchResult value ) {
// If value is not of type SearchResult, this will return false.
return( List.Contains( value ) );
}
protected override void OnInsert( int index, Object value ) {
if ( value.GetType() != typeof(SearchResult) )
throw new ArgumentException( "value must be of type SearchResult.", "value" );
}
protected override void OnRemove( int index, Object value ) {
if ( value.GetType() != typeof(SearchResult) )
throw new ArgumentException( "value must be of type SearchResult.", "value" );
}
protected override void OnSet( int index, Object oldValue, Object newValue ) {
if ( newValue.GetType() != typeof(SearchResult) )
throw new ArgumentException( "newValue must be of type SearchResult.", "newValue" );
}
protected override void OnValidate( Object value ) {
if ( value.GetType() != typeof(SearchResult) )
throw new ArgumentException( "value must be of type SearchResult." );
}
}
}
Jump to Line
Something went wrong with that request. Please try again.