Beispiel #1
0
        protected void AppendHtmlSynchronized(Document doc, ISynchronizeInvoke sync, ScriptOutputMessage output, string html)
        {
            if (string.IsNullOrWhiteSpace(html))
            {
                return;
            }

            ExecuteMethodSync(sync, () => AppendHtml(doc, output, html));
        }
Beispiel #2
0
 internal virtual void HandleScriptOutputMessage(ScriptOutputMessage message)
 {
     // Check if we have a subitem that must also handle this line
     if (currentSubItem != null)
     {
         currentSubItem.HandleScriptOutputMessage(message);
     }
     else
     {
         ReportItems.Add(new TrXmlEntry(message));
     }
 }
Beispiel #3
0
        protected virtual void AppendHtml(Document doc, ScriptOutputMessage output, string html)
        {
            doc.BeginUpdate();
            try
            {
                var range = doc.AppendHtmlText(html, DevExpress.XtraRichEdit.API.Native.InsertOptions.KeepSourceFormatting);

                doc.CaretPosition = range.End;
                ScrollToCaret();
            }
            catch (Exception ex)
            {
                ReportError(doc, ex);
            }
            finally
            {
                doc.EndUpdate();
            }
        }
Beispiel #4
0
        protected virtual void AppendImage(Document doc, ScriptOutputMessage output, string fileName)
        {
            doc.BeginUpdate();
            try
            {
                fileName = Project.Current.MapPath(fileName);
                doc.Images.Append(DocumentImageSource.FromFile(fileName));
                var paragraph = doc.Paragraphs.Append();

                doc.CaretPosition = paragraph.Range.End;
                ScrollToCaret();
            }
            catch (Exception ex)
            {
                ReportError(doc, ex);
            }
            finally
            {
                doc.EndUpdate();
            }
        }
Beispiel #5
0
        protected void FlushTextBufferSynchronized(Document doc, ISynchronizeInvoke sync, ScriptOutputMessage output, StringBuilder buffer)
        {
            if (buffer.Length <= 0)
            {
                return;
            }

            ExecuteMethodSync(sync, () => FlushTextBuffer(doc, output, buffer));
        }
Beispiel #6
0
 protected virtual void ProcessBuffer(Document doc, ISynchronizeInvoke sync,
                                      ScriptOutputMessage output, StringBuilder buffer)
 {
     FlushTextBufferSynchronized(doc, sync, output, buffer);
 }
Beispiel #7
0
        protected void AppendImageSynchronized(Document doc, ISynchronizeInvoke sync, ScriptOutputMessage output, string fileName)
        {
            if (string.IsNullOrWhiteSpace(fileName))
            {
                return;
            }

            ExecuteMethodSync(sync, () => AppendImage(doc, output, fileName));
        }
Beispiel #8
0
 protected virtual void FlushTextBuffer(Document doc, ScriptOutputMessage output, StringBuilder buffer)
 {
     FlushTextBuffer(doc, output.ForegroundColor, output.BackgroundColor, buffer);
 }
Beispiel #9
0
 public TrXmlEntry(ScriptOutputMessage message)
     : this(message as ScriptMessageBase)
 {
     MainType = TafTestReportItemMainType.ScriptOutputLine;
     EndTime  = message.TimeStamp;
 }
Beispiel #10
0
 public bool IsFormattingEqual(ScriptOutputMessage args2)
 {
     return(args2 != null && args2.ForegroundColor == this.ForegroundColor && args2.BackgroundColor == this.BackgroundColor);
 }