Contains()ArrayList methods define equalities using the implementation Equals()available to stored objects.
If you want two different instances of your class to be considered equivalent, you need to override the method Equals()to return true when they are. Then you should also overload GetHashCode()for consistency and usability in dictionaries. Here is an example:
public class CauseAssignment
{
private string _Path;
public override bool Equals( object o )
{
if( o == null || o.GetType() != typeof(CauseAssignment) )
return false;
CauseAssignment ca = (CauseAssignment)o;
return ca._Path.Equals( this._Path );
}
public override int GetHashCode()
{
return _Path.GetHashCode();
}
}