예제 #1
0
파일: api1.cs 프로젝트: wzchua/docs
    public static void Main()
    {
        FileName file1 = new FileName("autoexec.bat", null);
        FileName file2 = new FileName("AutoExec.BAT", null);

        Console.WriteLine(file1.CompareTo(file2));
    }
예제 #2
0
 public int CompareTo(object obj)
 {
     if (obj is BreakpointModel model)
     {
         return(FileName.CompareTo(model.FileName));
     }
     return(0);
 }
예제 #3
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));
        }
예제 #5
0
    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);
    }
예제 #6
0
        public int CompareTo(File file)
        {
            int temp = this.Size.CompareTo(file.Size);

            if (temp != 0)
            {
                return(temp);
            }
            else
            {
                return(FileName.CompareTo(file.FileName));
            }
        }
예제 #7
0
        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));
        }
예제 #8
0
 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");
     }
 }
예제 #9
0
 public int CompareTo(Object obj)
 {
     return(FileName.CompareTo(((SearchFile)obj).FileName));
 }
예제 #10
0
 public int CompareTo(SimpleModpackEntry obj)
 {
     return(FileName.CompareTo(obj.ItemName));
 }
예제 #11
0
 int CompareFileNames(MvcProjectFile other)
 {
     return(FileName.CompareTo(other.FileName));
 }
예제 #12
0
 public int CompareTo(DirectoryEntry other)
 {
     return(FileName.CompareTo(other.FileName));
 }
예제 #13
0
        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);
        }