Interaction logic for DrawingTestResultMethod.xaml
Inheritance: System.Windows.Controls.UserControl
示例#1
0
        static Control createMethodResultControl(TestResultMethod result)
        {
            Debug.Assert(result.Bitmap_ != null || result.Error_ != null);

            var control = new UI.DrawingTestResultMethod {
                MethodName = { Content = result.Name }
            };

            if (result.Error_ != null)
            {
                var label = new Label();
                showError(label, result.Error_);
                control.Result.Content = label;
                return(control);
            }

            var bitmap = result.Bitmap_;

            Debug.Assert(bitmap != null);

            var image = createImage(bitmap);

            control.Result.Content = image;

            var report = result.Report_;

            Debug.Assert(report != null);
            var reportString = string.Join("\n", report.Report.ToArray()).Trim();

            if (reportString != "")
            {
                control.Report.Content    = reportString;
                control.Report.Visibility = Visibility.Visible;
            }

            return(control);
        }
示例#2
0
        static Control createMethodResultControl(TestResultMethod result)
        {
            Debug.Assert(result.Bitmap_ != null || result.Error_ != null);

            var control = new UI.DrawingTestResultMethod { MethodName = { Content = result.Name } };

            if (result.Error_ != null)
            {
                var label = new Label();
                showError(label, result.Error_);
                control.Result.Content = label;
                return control;
            }

            var bitmap = result.Bitmap_;
            Debug.Assert(bitmap != null);

            var image = createImage(bitmap);

            control.Result.Content = image;

            var report = result.Report_;
            Debug.Assert(report != null);
            var reportString = string.Join("\n", report.Report.ToArray()).Trim();
            if (reportString != "")
            {
                control.Report.Content = reportString;
                control.Report.Visibility = Visibility.Visible;
            }

            return control;
        }