internal AlertAdornment(AlertTag alertTag) { Height = _size; Width = _size; Margin = new Thickness(5, 0, 0, 0); Padding = new Thickness(0); BorderThickness = new Thickness(0); Background = Brushes.Transparent; Cursor = Cursors.Arrow; AddChild(_image); Update(alertTag); }
internal void Update(AlertTag alertTag) { if (alertTag == null) { return; } Vulnerability vul = alertTag.Vulnerability; Uri url; if (vul.Info.Any() && Uri.TryCreate(vul.Info.FirstOrDefault(), UriKind.Absolute, out url)) { Click += (s, e) => { e.Handled = true; Process.Start(vul.Info.First()); }; } _image.Source = GetMoniker(vul.Severity).GetImage(_size); ToolTip = $"This package contains security issues.\n\nRisk level: {vul.Severity}"; }