Never use
ArrayList
in new development. All non-generic classes were rendered obsolete as early as of .NET v.2.0, when generics were implemented. They eliminate unwanted potentially dangerous element type casting. Use generic
System.Collections.Generic.List<>
and other generic collection.
Your code makes no sense at all, you compare some element with the whole array (if your
array
object is array; it is undeclared), which always be false. Moreover,
System.Equals
is not intended for direct call; its purpose is very different.
It's totally unclear what you are trying to achieve (if it even makes any sense at all; as is, it won't even compile because
array
is not declared and defined), but the closest approach you would need is this one of
Any
or
All
extension methods described here:
http://msdn.microsoft.com/en-us/library/6sh2ey19%28v=vs.110%29.aspx[
^].
—SA