/// <summary> /// Compares all the bytes in the two ranges of the arrays. /// Returns true iff the ranges have the same byte values. /// </summary> /// <param name="array">The first array to compare.</param> /// <param name="offset">The offset of the first byte to compare in the first array.</param> /// <param name="other">The second array to compare.</param> /// <param name="otherOffset">The offset of the first byte to compare in the second array.</param> /// <param name="count">The number of bytes to compare.</param> /// <returns>True iff the ranges have the same byte values.</returns> public static bool SequenceEqual(this byte[] array, int offset, byte[] other, int otherOffset, int count) { if (array == null) throw new ArgumentNullException("array"); return array.Compare(offset, other, otherOffset, count) == 0; }
public static bool Compare(this XmlDiff xmlDiff, Stream srcStream, Stream diffStream) { XmlTextReader src = new XmlTextReader(srcStream); XmlTextReader dest = new XmlTextReader(diffStream); xmlDiff.IgnoreWhitespace = true; return xmlDiff.Compare(src, dest); }
public static bool Compare(this FileInfo currentFile, FileInfo otherFile) { if (currentFile == null || otherFile == null) return false; return currentFile.Compare(otherFile.FullName); }
internal static void ShouldBeCopiedOK(this IPersistentBufferProvider @this,string iPath) { bool res = @this.CopyTo(iPath); res.Should().BeTrue(); File.Exists(iPath).Should().BeTrue(); IPersistentBufferProvider bc = InternalBufferFactory.GetBufferProviderFromFile(iPath); bc.Should().NotBeNull(); @this.Compare(bc).Should().BeTrue(); @this.CopyTo("").Should().BeFalse(); }
internal static IBufferProvider ShouldBeClonedOK(this IPersistentBufferProvider @this) { IBufferProvider res = @this.Clone(); res.Should().NotBeNull(); object.ReferenceEquals(res, @this).Should().BeFalse(); @this.Compare(res).Should().BeTrue(); return res; }
public static void AutoCheck(this ICheckerCompare compare, IEnumerable<PropertyInfo> properties) { // Setup the comparisons foreach (var prop in properties) { // Exclude indexers var x = prop.GetIndexParameters(); if (x.GetLength(0) != 0) { continue; } compare.Compare(prop); } }
/// <summary> /// 現在のインスタンスと月を比較する。 /// </summary> /// <param name="self">自分自身</param> /// <param name="value">比較する値</param> /// <returns>比較結果(true:一致, false:不一致)</returns> public static bool CompareMonth(this DateTime self, DateTime value) { return self.Compare(value, DateTimeKind.Month); }
public static string ToString(this MDEntryType[] array) { if (array.Compare(MDEntryTypes.All)) return "All"; var a = array.Select(t => t.ToString()).ToArray(); return string.Join("+", a); }
/// <summary> /// 現在のインスタンスとミリ秒を比較する。 /// </summary> /// <param name="self">自分自身</param> /// <param name="value">比較する値</param> /// <returns>比較結果(true:一致, false:不一致)</returns> public static bool CompareMillisecond(this DateTime self, DateTime value) { return self.Compare(value, DateTimeKind.Milliseconds); }
/// <summary> /// 現在のインスタンスと年を比較する。 /// </summary> /// <param name="self">自分自身</param> /// <param name="value">比較する値</param> /// <returns>比較結果(true:一致, false:不一致)</returns> public static bool CompareYear(this DateTime self, DateTime value) { return self.Compare(value, DateTimeKind.Year); }
/// <summary> /// 現在のインスタンスと分を比較する。 /// </summary> /// <param name="self">自分自身</param> /// <param name="value">比較する値</param> /// <returns>比較結果(true:一致, false:不一致)</returns> public static bool CompareMinute(this DateTime self, DateTime value) { return self.Compare(value, DateTimeKind.Minute); }
/// <summary> /// 現在のインスタンスと秒を比較する。 /// </summary> /// <param name="self">自分自身</param> /// <param name="value">比較する値</param> /// <returns>比較結果(true:一致, false:不一致)</returns> public static bool CompareSecond(this DateTime self, DateTime value) { return self.Compare(value, DateTimeKind.Second); }
/// <summary> /// 現在のインスタンスと日を比較する。 /// </summary> /// <param name="self">自分自身</param> /// <param name="value">比較する値</param> /// <returns>比較結果(true:一致, false:不一致)</returns> public static bool CompareDay(this DateTime self, DateTime value) { return self.Compare(value, DateTimeKind.Day); }
public static IFolderComparisonReport Compare(this IFolder folder1, string[] folderContent2, ReportOption reportOption = ReportOption.EqualOnly) { if (folderContent2 == null) { IFolder folder2 = null; return folder1.Compare(folder2); } using (var temporaryFolder = new TemporaryFolder()) { foreach (string folderEntity in folderContent2) { temporaryFolder.CreateFile(folderEntity); } return folder1.Compare(temporaryFolder, reportOption); } }
public static bool StartsWith(this byte[] array1, params byte[] array2) { return array1.Compare(true, array2); }
public static bool Compare(this byte[] array1, int[] anyMaskIndexes, params byte[] array2) { return array1.Compare(false, anyMaskIndexes, array2); }
public static bool Compare(this byte[] array1, params byte[] array2) { return array1.Compare(false, array2); }
/// <summary> /// Returns the auto-attack range. /// </summary> /// <param name="target"> /// The target. /// </param> /// <returns> /// The <see cref="float" />. /// </returns> public static float GetRealAutoAttackRange(this AttackableUnit target) { return GetRealAutoAttackRange(GameObjects.Player, target.Compare(GameObjects.Player) ? null : target); }
public static IComparer Invert(this IComparer comparer) { return new FuncToComparer((x, y) => -comparer.Compare(x, y)); }