CSharp examples for System.Collections.Generic:IList
Removes the first occurrence of a specific object from the System.Collections.IList. Deals with null IList
using System.Linq; using System.Collections.Generic; using System.Collections; using System;/* w ww. j a v a 2s .c o m*/ using Cirrious.CrossCore.Platform; public class Main{ /// <summary> /// Removes the first occurrence of a specific object from the System.Collections.IList. /// Deals with null IList /// </summary> /// <param name="source">The source.</param> /// <param name="valueToRemove">The value to remove.</param> public static void SafeRemove(this IList source, object valueToRemove) { if (source != null) source.Remove(valueToRemove); } }