예제 #1
0
 public ScanWorker(List <FileScan> scans, DatabaseManager database, VirustotalClient client, BlockingCollection <string> queue, CancellationTokenSource token)
 {
     this.scans    = scans;
     this.database = database;
     this.client   = client;
     this.queue    = queue;
     this.token    = token;
 }
예제 #2
0
        public ScanManager(VirustotalClient client, DatabaseManager database, Quarantine quarantine, List <FileScan> scans)
        {
            this.client     = client;
            this.database   = database;
            this.quarantine = quarantine;
            this.Scans      = scans;

            this.quarantine.OnScanUpdated += scan => this.OnScanUpdated?.Invoke(scan);
        }
예제 #3
0
파일: App.xaml.cs 프로젝트: Kobzol/pvbps
        public App()
        {
            this.config = this.ParseConfig("config.json");

            this.client      = new VirustotalClient(this.config.ApiUrl, this.config.ApiKey);
            this.database    = new DatabaseManager(this.config.DatabaseFile);
            this.quarantine  = new Quarantine(this.config.QuarantinePath, this.config.QuarantineKey);
            this.scanManager = new ScanManager(this.client, this.database, this.quarantine, this.database.GetScans());

            this.Exit += this.HandleExit;

            this.SetupDatabasePersist();
        }
예제 #4
0
        public MainWindow(ScanManager scanManager, DatabaseManager database, VirustotalClient client)
        {
            this.scanManager = scanManager;
            this.database    = database;
            this.client      = client;
            this.DataContext = this;

            this.InitializeComponent();

            this.UpdateScans(this.scanManager.Scans);
            this.scanManager.OnScanCreated += this.OnScanCreated;
            this.scanManager.OnScanUpdated += this.OnScanUpdated;
            this.client.OnStatus           += this.OnRequestStatus;
        }