예제 #1
0
        private void Fix([NotNull] object sender, [NotNull] RoutedEventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            var fix = FixManager.GetFix(Item);

            if (fix == null)
            {
                return;
            }

            fix.Fix(Item);
        }
예제 #2
0
        public ValidationPresenter([NotNull] IValidationViewerSkin skin, [NotNull] ValidationDescriptor item)
        {
            Assert.ArgumentNotNull(skin, nameof(skin));
            Assert.ArgumentNotNull(item, nameof(item));

            InitializeComponent();

            Skin = skin;
            Item = item;

            Severity = item.Severity;
            Title    = item.Title;
            Problem  = item.Problem;
            Solution = item.Solution;

            if (string.IsNullOrEmpty(item.Problem))
            {
                ProblemField.Visibility = Visibility.Collapsed;
            }

            if (string.IsNullOrEmpty(item.Solution))
            {
                SolutionField.Visibility = Visibility.Collapsed;
            }

            if (string.IsNullOrEmpty(item.ExternalLink))
            {
                ExternalLink.Visibility = Visibility.Collapsed;
            }

            if (item.ItemUri != ItemVersionUri.Empty)
            {
                ItemPath.Inlines.Add(item.ItemPath);
            }
            else
            {
                ItemLink.Visibility = Visibility.Collapsed;
            }

            var fix = FixManager.GetFix(item);

            if (fix == null)
            {
                FixButton.Visibility = Visibility.Collapsed;
            }
        }