This is an alternative to the original poster's "solution 1", which really does need some help.
public static bool
AllTheSame<T>
(
this System.Collections.Generic.IList<T> List
)
where T : System.IEquatable<T>
{
if ( List == null )
{
throw ( new System.ArgumentNullException ( "List" , "List must not be null" ) ) ;
}
bool result = true ;
if ( List.Count > 1 )
{
T first = List [ 0 ] ;
if ( (object) first == null )
{
for ( int i = 1 ; result && ( i < List.Count ) ; i++ )
{
result = (object) List [ i ] == null ;
}
}
else
{
for ( int i = 1 ; result && ( i < List.Count ) ; i++ )
{
result = first.Equals ( List [ i ] ) ;
}
}
}
return ( result ) ;
}