Пример #1
0
 public void Disinfect(Objects.ViralInfection virus)
 {
     if (FoundViruses.Contains(virus))
     {
         FoundViruses.Remove(virus);
         VirusManager.Disinfect(virus.ID);
         if (virus is FileViralInfection)
         {
             var fVirus = virus as FileViralInfection;
             if (Objects.ShiftFS.Utils.FileExists(fVirus.FilePath))
             {
                 var headerText = Objects.ShiftFS.Utils.GetHeaderText(fVirus.FilePath);
                 try
                 {
                     var list   = JsonConvert.DeserializeObject <List <FileViralInfection> >(headerText);
                     var hVirus = list.FirstOrDefault(x => x.ID == virus.ID && x.ThreatLevel == virus.ThreatLevel);
                     list.Remove(hVirus);
                     Objects.ShiftFS.Utils.SetHeaderText(fVirus.FilePath, JsonConvert.SerializeObject(list));
                 }
                 catch
                 {
                 }
             }
         }
     }
     SetupSummary();
 }
Пример #2
0
        public static void Disinfect(Dictionary <string, object> args)
        {
            var id = args["id"].ToString();

            VirusManager.Disinfect(id);
        }