コード例 #1
0
ファイル: RemoveLast.cs プロジェクト: Entomy/LibLangly
 /// <summary>
 /// Removes the last instance of the elements from this object.
 /// </summary>
 /// <typeparam name="TElement">The type of the elements in the collection.</typeparam>
 /// <param name="collection">This collection.</param>
 /// <param name="elements">The elements to remove.</param>
 public static void RemoveLast <TElement>(this IRemove <TElement> collection, Collections.Generic.IEnumerable <TElement>?elements)
 {
     if (elements is not null)
     {
         foreach (TElement element in elements)
         {
             collection.RemoveLast(element);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Prepends the elements onto this object, one by one.
 /// </summary>
 /// <typeparam name="TElement">The type of the elements in the collection.</typeparam>
 /// <param name="collection">This collection.</param>
 /// <param name="elements">The elements to prepend.</param>
 public static void Prepend <TElement>(this IPrepend <TElement> collection, Collections.Generic.IEnumerable <TElement>?elements)
 {
     if (elements is not null)
     {
         foreach (TElement element in elements)
         {
             collection.Prepend(element);
         }
     }
 }
コード例 #3
0
        public void FieldsAreFound(Type type, FieldSource source, FieldCollection expectedFields)
        {
            var fields = type.FindFields(source);

            Assert.Equal(expectedFields, fields);
        }
コード例 #4
0
 public static bool SafeAny<T>(this IEnumerable<T> collection)
 {
     return collection?.Any() ?? false;
 }