public static void Main() { FileName file1 = new FileName("autoexec.bat", null); FileName file2 = new FileName("AutoExec.BAT", null); Console.WriteLine(file1.CompareTo(file2)); }
public int CompareTo(object obj) { if (obj is BreakpointModel model) { return(FileName.CompareTo(model.FileName)); } return(0); }
public void TestMethod_Compare_date_earlier_than() { //GESTION_J_4_backup_2020_10_06_20_00_07_127.diff var source1 = new FileName("GESTION_J_4_backup_2020_10_06_20_00_07_127.diff"); var source2 = new FileName("GESTION_J_4_backup_2020_10_05_20_00_07_127.diff"); int expected = 1; var result = source1.CompareTo(source2); Assert.AreEqual(expected, result); }
public int CompareTo(object obj) { if (!(obj is SimpleFileInfo)) { throw new ArgumentException("Incorrect type in SimpleCompare.CompareTo!"); } SimpleFileInfo other = (SimpleFileInfo)obj; return(FileName.CompareTo(other.FileName) == 0 ? FileLength.CompareTo(other.FileLength) : FileName.CompareTo(other.FileName)); }
public int CompareTo(object obj) { GPhotoCameraFile f2 = obj as GPhotoCameraFile; int result = Directory.CompareTo(f2.Directory); if (result == 0) { result = FileName.CompareTo(f2.FileName); } return(result); }
public int CompareTo(File file) { int temp = this.Size.CompareTo(file.Size); if (temp != 0) { return(temp); } else { return(FileName.CompareTo(file.FileName)); } }
public virtual int CompareTo(object obj) { if (obj == null) { return(1); } if (GetType() != obj.GetType()) { // if of different types, sort the types by name return(GetType().Name.CompareTo(obj.GetType().Name)); } var b = obj as DefaultNavigationPoint; return(FileName.CompareTo(b.FileName)); }
public int CompareTo(object obj) { if (obj is FileContainer) { FileContainer fc = obj as FileContainer; int result = FileType.CompareTo(fc.FileType); if (result != 0) { return(result); } return(FileName.CompareTo(fc.FileName)); } else { throw new Exception("Wrong type"); } }
public int CompareTo(Object obj) { return(FileName.CompareTo(((SearchFile)obj).FileName)); }
public int CompareTo(SimpleModpackEntry obj) { return(FileName.CompareTo(obj.ItemName)); }
int CompareFileNames(MvcProjectFile other) { return(FileName.CompareTo(other.FileName)); }
public int CompareTo(DirectoryEntry other) { return(FileName.CompareTo(other.FileName)); }
public Int32 CompareTo(IResultKey other) { if (!Equals(other)) { Int32 result = AssemblyName.CompareTo(other.AssemblyName); if (result != 0) { return(result); } result = TargetRuntime.Framework.CompareTo(other.TargetRuntime.Framework); if (result != 0) { return(result); } result = TargetRuntime.Version.CompareTo(other.TargetRuntime.Version); if (result != 0) { return(result); } result = TargetArchitecture.CompareTo(other.TargetArchitecture); if (result != 0) { return(result); } result = ExecutionRuntime.Framework.CompareTo(other.ExecutionRuntime.Framework); if (result != 0) { return(result); } result = ExecutionRuntime.Version.CompareTo(other.ExecutionRuntime.Version); if (result != 0) { return(result); } result = ExecutionArchitecture.CompareTo(other.ExecutionArchitecture); if (result != 0) { return(result); } result = FileName.CompareTo(other.FileName); if (result != 0) { return(result); } result = MethodName.CompareTo(other.MethodName); if (result != 0) { return(result); } } return(0); }