Esempio n. 1
0
        public MainWindow(IEnumerable <Threat> threats)
        {
            InitializeComponent();
            var threatViewer = new ThreatViewer();

            MainThreatViewer.Content = threatViewer;
            MainThreatList.Content   = new ThreatList(threats, threatViewer);
        }
Esempio n. 2
0
        public UpdateReportWindow(UpdateReport report)
        {
            InitializeComponent();
            AddedNumber.Text   = report.AddedThreats.Count.ToString();
            RemovedNumber.Text = report.RemovedThreats.Count.ToString();
            UpdatedNumber.Text = report.UpdateThreatInfos.Count.ToString();
            var addedThreatViewer = new ThreatViewer();

            AddedThreatViewer.Content = addedThreatViewer;
            AddedThreatList.Content   = new ThreatList(report.AddedThreats, addedThreatViewer);
            var removedThreatViewer = new ThreatViewer();

            RemovedThreatViewer.Content = removedThreatViewer;
            RemovedThreatList.Content   = new ThreatList(report.RemovedThreats, removedThreatViewer);
            var updatedNewThreatViewer = new ThreatViewer();
            var updatedOldThreatViewer = new ThreatViewer();

            UpdatedNewThreatViewer.Content = updatedNewThreatViewer;
            UpdatedOldThreatViewer.Content = updatedOldThreatViewer;
            UpdatedThreatList.Content      = new UpdatedThreatList(report.UpdateThreatInfos, updatedOldThreatViewer, updatedNewThreatViewer);
        }
Esempio n. 3
0
 public ThreatList(IEnumerable <Threat> threats, ThreatViewer viewer)
 {
     InitializeComponent();
     DataContext = new ThreatListViewModel(threats);
     _viewer     = viewer;
 }
Esempio n. 4
0
 public UpdatedThreatList(List <UpdateThreatInfo> infos, ThreatViewer oldThreatViewer, ThreatViewer newThreatViewer)
     : base(infos.Select(info => info.OldThreat), oldThreatViewer)
 {
     _newThreatViewer = newThreatViewer;
     _infos           = infos;
 }