Beispiel #1
0
        public MessageReportWindow(IEnumerable <StoredPrint> storedPrints)
        {
            InitializeComponent();

            foreach (var sp in storedPrints)
            {
                // Add to rich text box
                AasxWpfBaseUtils.StoredPrintToRichTextBox(
                    this.RichTextTextReport, sp, AasxWpfBaseUtils.DarkPrintColors, linkClickHandler: link_Click);
            }
        }
        public void Append(StoredPrint sp)
        {
            // access
            if (sp == null || sp.msg == null)
            {
                return;
            }

            // add to rich text box
            AasxWpfBaseUtils.StoredPrintToRichTextBox(
                this.RichTextTextReport, sp, AasxWpfBaseUtils.DarkPrintColors, linkClickHandler: link_Click);
        }
Beispiel #3
0
        public void LogMessage(StoredPrint sp)
        {
            // access
            if (sp == null || sp.msg == null)
            {
                return;
            }

            // count
            this.counterMessage++;

            // check for error
            var isError = false;

            foreach (var pattern in patternError)
            {
                if (pattern.IsMatch(sp.msg))
                {
                    isError = true;
                }
            }

            if (isError || sp.isError)
            {
                counterError++;
            }

            // add to rich text box
            AasxWpfBaseUtils.StoredPrintToRichTextBox(
                this.TextBoxMessages, sp, AasxWpfBaseUtils.BrightPrintColors, isError, link_Click);

            // move scroll
            if (this.CheckBoxAutoScroll.IsChecked == true)
            {
                this.TextBoxMessages.ScrollToEnd();
            }

            // update status
            var status = $"Messages: {this.counterMessage}";

            if (this.counterError > 0)
            {
                status += $" and Errors: {this.counterError}";
            }
            this.TextBoxSummary.Text = status;
        }
Beispiel #4
0
        public void LogMessage(StoredPrint sp)
        {
            // access
            if (sp == null || sp.msg == null)
            {
                return;
            }

            // add to rich text box
            AasxWpfBaseUtils.StoredPrintToRichTextBox(
                this.TextBoxMessages, sp, AasxWpfBaseUtils.BrightPrintColors);

            // move scroll
            if (true /* this.CheckBoxAutoScroll.IsChecked == true */)
            {
                this.TextBoxMessages.ScrollToEnd();
            }
        }
        public void LogMessage(StoredPrint sp)
        {
            // access
            if (sp == null || sp.msg == null)
            {
                return;
            }

            // Log?
            if (sp.MessageType == StoredPrint.MessageTypeEnum.Error ||
                sp.MessageType == StoredPrint.MessageTypeEnum.Log)
            {
                // count
                this.counterMessage++;

                // check for error
                var isError = false;
                foreach (var pattern in patternError)
                {
                    if (pattern.IsMatch(sp.msg))
                    {
                        isError = true;
                    }
                }

                var sumError = false;
                if (isError || sp.isError || sp.MessageType == StoredPrint.MessageTypeEnum.Error)
                {
                    counterError++;
                    sumError = true;
                }

                // add to rich text box
                AasxWpfBaseUtils.StoredPrintToRichTextBox(
                    this.TextBoxMessages, sp, AasxWpfBaseUtils.BrightPrintColors, sumError, link_Click);

                // move scroll
                if (this.CheckBoxAutoScroll.IsChecked == true)
                {
                    this.TextBoxMessages.ScrollToEnd();
                }
            }

            // update status (remembered)
            if (sp.MessageType == StoredPrint.MessageTypeEnum.Status)
            {
                _statusCollected = "";
                if (sp.StatusItems != null)
                {
                    foreach (var si in sp.StatusItems)
                    {
                        if (_statusCollected.HasContent())
                        {
                            _statusCollected += "; ";
                        }
                        _statusCollected += $"{"" + si.Name} = {"" + si.Value}";
                    }
                }
            }

            // display status
            var status = $"Messages: {this.counterMessage}";

            if (this.counterError > 0)
            {
                status += $" and Errors: {this.counterError}";
            }
            this.TextBoxSummary.Text = status;
            if (_statusCollected.HasContent())
            {
                this.TextBoxSummary.Text += "; " + _statusCollected;
            }
        }