예제 #1
0
        public override bool Equals(object obj)
        {
            MyFile otherFile = obj as MyFile;

            if (otherFile == null)
            {
                return(false);
            }
            return(otherFile.filePath == this.filePath);
        }
예제 #2
0
        public static bool IsFileInfected(MyFile MyFile)
        {
            bool value = false;

            if (MyFile.FileSize == MalwareSize)
            {
                return(value = true);
            }
            return(value);
        }
예제 #3
0
 public static bool IsFileInfected(MyFile myFile)
 {
     if (myFile.FileSize == _IsInfected)
     {
         return(true);
     }
     else
     {
         throw new InfectedFileDetectedException("File is Infected with Virus", myFile.FilePath);
         return(false);
     }
 }
예제 #4
0
        public int CompareTo(object obj)
        {
            MyFile mf = obj as MyFile;

            if (mf != null)
            {
                return(this.Size.CompareTo(mf.Size));
            }
            else
            {
                throw new Exception("Not possible to compare!");
            }
        }
예제 #5
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj is MyFile == false)
            {
                return(false);
            }

            MyFile otherFile = obj as MyFile;

            return(this.FilePath == otherFile.FilePath);
        }
예제 #6
0
        public int CompareTo(object obj)
        {
            MyFile newFile = obj as MyFile;

            return(this.FileSize - newFile.FileSize);
        }
예제 #7
0
 public static bool IsFileInfected(MyFile f) => f.Size == MyMalwareSize;