Lines Matching refs:source
366 public static Boolean StartsWith(this String source, char value) in StartsWith() argument
368 if (source.Length > 0) in StartsWith()
370 return source[0] == value; in StartsWith()
375 public static Boolean EndsWith(this String source, char value) in EndsWith() argument
377 if (source.Length > 0) in EndsWith()
379 return source[source.Length - 1] == value; in EndsWith()
393 …public static int IndexOf<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) in IndexOf() argument
396 foreach (var element in source) in IndexOf()
406 …public static int LastIndexOf<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predi… in LastIndexOf() argument
408 var revSource = source.Reverse(); in LastIndexOf()
421 …public static TSource MinBy<TSource, T>(this IEnumerable<TSource> source, Func<TSource, T> map) wh…
423 return source.Aggregate((a, b) => map(a).CompareTo(map(b)) < 0 ? a : b);
427 …public static string Stringify<TSource>(this IEnumerable<TSource> source, string separator = " ", … in Stringify() argument
429 …return Stringify(source.Select(x => x == null ? String.Empty : x.ToString()), separator, limitPerL… in Stringify()
432 …public static string Stringify(this IEnumerable<string> source, string separator = " ", int limitP… in Stringify() argument
435 if(source.Any()) in Stringify()
437 …return source.Aggregate((x, y) => x + separator + (limitPerLine != 0 && (++idx % limitPerLine == 0… in Stringify()
506 …IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKe… in DistinctBy() argument
509 if(source == null) in DistinctBy()
518 foreach (var element in source) in DistinctBy()
531 public static IEnumerable<T> Append<T>(this IEnumerable<T> source, params T[] element) in Append() argument
533 if(source == null) in Append()
537 return ConcatIterator(element, source, false); in Append()
554 IEnumerable<T> source, bool insertAtStart) in ConcatIterator() argument
563 foreach(var e in source) in ConcatIterator()
908 …public static void FillPacketWithChecksums(IPeripheral source, byte[] packet, params TransportLaye… in FillPacketWithChecksums() argument
911 …source.Log(LogLevel.Error, String.Format("Expected packet of at least {0} bytes, got {1}.", MACLen… in FillPacketWithChecksums()
919 …source.Log(LogLevel.Error, String.Format("Unknown packet type: 0x{0:X}. Supported are: 0x800 (IP) … in FillPacketWithChecksums()
923 source.Log(LogLevel.Error, "IP Packet is too short!"); in FillPacketWithChecksums()
928 …source.Log(LogLevel.Error, String.Format("Only IPv4 packets are supported. Got IPv{0}", (packet[MA… in FillPacketWithChecksums()
939 source.Log(LogLevel.Error, "Something is wrong - IP packet of len 0"); in FillPacketWithChecksums()
1389 …public static bool TryCreateFrameOrLogWarning(IEmulationElement source, byte[] data, out EthernetF… in TryCreateFrameOrLogWarning() argument
1395 …source.Log(LogLevel.Warning, "Insufficient data to create an ethernet frame, expected {0} bytes bu… in TryCreateFrameOrLogWarning()
1561 public static T[] CopyAndResize<T>(this T[] source, int length) in CopyAndResize() argument
1563 if(source.Length == length) in CopyAndResize()
1565 return source.ToArray(); in CopyAndResize()
1568 Array.Copy(source, data, Math.Min(source.Length, length)); in CopyAndResize()