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

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

            if (MyFile.FileSize == MalwareSize)
            {
                return(value = true);
            }
            return(value);
        }
Beispiel #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);
     }
 }
Beispiel #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!");
            }
        }
Beispiel #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);
        }
Beispiel #6
0
        public int CompareTo(object obj)
        {
            MyFile newFile = obj as MyFile;

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