public static string String_Join <T>(System.Collections.Generic.IList <T> objects) { const string Sepa = ", "; #if !NETCF && DEBUG T[] objectArray = new T[objects.Count]; objects.CopyTo(objectArray, 0); string[] arr = Array.ConvertAll <T, string>(objectArray, delegate(T cur) { return(cur.ToString()); }); string allX = string.Join(", ", arr); #endif StringBuilder bldr = new StringBuilder(); foreach (T cur in objects) { bldr.Append(cur.ToString()); bldr.Append(Sepa); } if (bldr.Length > 0) { bldr.Length -= Sepa.Length; } #if !NETCF && DEBUG Debug.Assert(bldr.ToString() == allX, "two ways equal?!!"); #endif return(bldr.ToString()); }
public static Object[] sortFactsByTemplate(System.Collections.Generic.IList <Object> facts) { Object[] sorted = new object[facts.Count]; facts.CopyTo(sorted, 0); Arrays.sort(sorted, TEMPLATECOMP); return(sorted); }
public static Object[] sortFacts(System.Collections.Generic.IList <Object> facts) { Object[] sorted = new object[facts.Count]; facts.CopyTo(sorted, 0); Arrays.sort(sorted, COMPARATOR); return(sorted); }
public static void ListSort <E>(System.Collections.Generic.IList <E> list, System.Collections.Generic.IComparer <E> comparator) { E[] arr = new E[list.Count]; list.CopyTo(arr, 0); if (comparator == null) { System.Array.Sort(arr); } else { System.Array.Sort(arr, comparator); } for (int i = 0; i < arr.Length; i++) { list[i] = arr[i]; } }
public PaletteQuantizer(System.Collections.Generic.IList <Color> palette) : this(palette.Count) { palette.CopyTo(_colors, 0); }
public virtual void CopyTo(ENTITY[] array, int index) { _selectedList.CopyTo(array, index); }