BigML.Utils.sameElement C# (CSharp) Méthode

sameElement() public static méthode

Determines if the given collection contain the same value. We will use the contains method of the list to check if the value is inside
public static sameElement ( IList collection, object value ) : bool
collection IList the list of elements
value object the value to check.
Résultat bool
        public static bool sameElement(IList collection, object value)
        {
            if (collection == null || collection.Count == 0)
            {
                return false;
            }

            // Iterate over the elements of the collection.
            foreach (object collectionValue in collection)
            {
                // Check if the element in the collection is the same of value
                if (!collectionValue.Equals(value))
                {
                    return false;
                }
            }

            return true;
        }