public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     var stringLogTitle = logEntry.Title as StringLogTitle;
     if (stringLogTitle != null)
     {
         stringBuilder.Append(stringLogTitle.Title);
     }
     else
     {
         var openLogScope = logEntry.Title as OpenLogScopeTitle;
         if (openLogScope != null)
         {
             stringBuilder.Append("Open[");
             stringBuilder.Append(logEntry.LogScopeId);
             stringBuilder.Append("]");
         }
         else
         {
             var closeLogScope = logEntry.Title as CloseLogScopeTitle;
             if (closeLogScope != null)
             {
                 stringBuilder.Append("Close[");
                 stringBuilder.Append(logEntry.LogScopeId);
                 stringBuilder.Append("]");
             }
         }
     }
 }
 public void Render(StringBuilder stringBuilder,IStringRenderer stringRenderer, LogEntry logEntry)
 {
     for (int i = 0; i < m_writers.Length; i++)
     {
         m_writers[i].Render(stringBuilder, stringRenderer, logEntry);
     }
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(m_property);
     if (logEntry.Paramaeter != null)
     {
         stringRenderer.Render(m_parmExtractor.DynamicInvoke(logEntry.Paramaeter), stringBuilder);
     }
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(DateTime.Now);
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(m_stringPattern);
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(System.Threading.Thread.CurrentThread.ManagedThreadId);
 }
Example #8
0
        /**
         * Based on the backtrace information, words are aligned as appropriate with insertions and deletions causing
         * asterisks to be placed in the word lists.  This generates the alignedReferenceWords and alignedHypothesisWords
         * lists.
         *
         * @param backtrace the backtrace list created in backtrace
         */
        void AlignWords(LinkedList <Integer> backtrace, IStringRenderer renderer)
        {
            var    referenceWordsIterator  = _referenceItems.GetEnumerator();
            var    hypothesisWordsIterator = _hypothesisItems.GetEnumerator();
            string referenceWord;
            string hypothesisWord;
            Object a = null;
            Object b = null;

            _alignedReferenceWords  = new LinkedList <string>();
            _alignedHypothesisWords = new LinkedList <string>();


            for (var m = backtrace.Count - 2; m >= 0; m--)
            {
                int backtraceEntry = backtrace.ElementAt(m);

                if (backtraceEntry != Insertion)
                {
                    referenceWordsIterator.MoveNext();
                    a             = referenceWordsIterator.Current;
                    referenceWord = renderer.GetRef(a, b);
                }
                else
                {
                    referenceWord = null;
                }
                if (backtraceEntry != Deletion)
                {
                    hypothesisWordsIterator.MoveNext();
                    b = hypothesisWordsIterator.Current;
                    hypothesisWord = renderer.GetHyp(a, b);
                }
                else
                {
                    hypothesisWord = null;
                }
                switch (backtraceEntry)
                {
                case Substitution:
                {
                    referenceWord  = referenceWord.ToUpper();
                    hypothesisWord = hypothesisWord.ToUpper();
                    break;
                }

                case Insertion:
                {
                    hypothesisWord = hypothesisWord.ToUpper();
                    break;
                }

                case Deletion:
                {
                    referenceWord = referenceWord.ToUpper();
                    break;
                }

                case Ok:
                    break;
                }

                // Expand the missing words out to be all *'s.
                //
                if (referenceWord == null)
                {
                    referenceWord = Stars.Substring(0, hypothesisWord.Length);
                }
                if (hypothesisWord == null)
                {
                    hypothesisWord = Stars.Substring(0, referenceWord.Length);
                }

                // Fill the words up with spaces so they are the same
                // Length.
                //
                if (referenceWord.Length > hypothesisWord.Length)
                {
                    hypothesisWord = hypothesisWord + (Spaces.Substring(0, referenceWord.Length - hypothesisWord.Length));
                }
                else if (referenceWord.Length < hypothesisWord.Length)
                {
                    referenceWord = referenceWord + (Spaces.Substring(0, hypothesisWord.Length - referenceWord.Length));
                }

                Java.Add(_alignedReferenceWords, referenceWord);
                Java.Add(_alignedHypothesisWords, hypothesisWord);
            }
        }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringRenderer.Render(logEntry.Paramaeter, stringBuilder);
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(logEntry.LogScopeId);
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.AppendLine();
 }