public void SetContent(string content, MessageContentFormat contentType, QueueItemError errorMsg = null) { switch(contentType) { case MessageContentFormat.Xml: tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Xml; tbContent.Text = content; break; case MessageContentFormat.Json: tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Json; tbContent.Text = content; break; } if( errorMsg != null ) { theGrid.RowDefinitions[1].Height = new GridLength(61); lbError.Text = errorMsg.Message; lbRetries.Text = errorMsg.Retries.ToString(); if( errorMsg.State == QueueItemErrorState.Retry ) { imgError.Source = BMP_WARNING; lbError.Background = BACKGROUND_WARNING; lbRetries.Foreground = BACKGROUND_WARNING; } else { imgError.Source = BMP_ERROR; lbError.Background = BACKGROUND_ERROR; lbRetries.Foreground = BACKGROUND_ERROR; } } else { theGrid.RowDefinitions[1].Height = new GridLength(0); } }
public void SetContentFormat(string content) { if( content.StartsWith("<xml") ) ContentFormat = MessageContentFormat.Xml; else //if( content.StartsWith("[") || content.StartsWith("{") ) ContentFormat = MessageContentFormat.Json; //else ContentFormat = MessageContentFormat.Other; }
public Queue(string name, QueueType type, int color = 0, MessageContentFormat contentFormat = MessageContentFormat.Unknown) { Name = name; Type = type; DisplayName = name.CutBeginning(46); Color = color; ContentFormat = contentFormat; ColorString = "#" + color.ToString("X"); SelectedColorString = "#" + GetSelectedColor(color).ToString("X"); }
public Queue(string name, QueueType type, int color = 0) { Name = name; Type = type; DisplayName = name.CutBeginning(46); Color = color; ContentFormat = MessageContentFormat.Unknown; ColorString = "#" + color.ToString("X"); SelectedColorString = "#" + GetSelectedColor(color).ToString("X"); }
public void SetContentFormat(string content) { if (content.StartsWith("<xml")) { ContentFormat = MessageContentFormat.Xml; } else //if( content.StartsWith("[") || content.StartsWith("{") ) { ContentFormat = MessageContentFormat.Json; } //else ContentFormat = MessageContentFormat.Other; }
public void SetContent(string content, MessageContentFormat contentType, QueueItemError errorMsg = null) { if (content.IsValid() && !content.StartsWith("**")) { if (contentType == MessageContentFormat.Xml) { tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Xml; } else if (contentType == MessageContentFormat.Json) { tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Json; } } else { tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Plain; } tbContent.Text = content; if (errorMsg != null) { theGrid.RowDefinitions[1].Height = new GridLength(61); lbError.Text = errorMsg.Message; imgStackTrace.ToolTip = errorMsg.StackTrace; lbRetries.Text = errorMsg.Retries.ToString(); if (errorMsg.State == QueueItemErrorState.Retry) { imgError.Source = WARNING_BMP; lbError.Background = WARNING_BACKGROUND; gsError.Background = WARNING_SPLITHANDLE; lbRetries.Foreground = WARNING_BACKGROUND; } else { imgError.Source = ERROR_BMP; lbError.Background = ERROR_BACKGROUND; gsError.Background = ERROR_SPLITHANDLE; lbRetries.Foreground = ERROR_BACKGROUND; } } else { theGrid.RowDefinitions[1].Height = new GridLength(0); } }
public void SetContent(string content, MessageContentFormat contentType, QueueItemError errorMsg = null) { if( content.IsValid() && !content.StartsWith("**") ) { if( contentType == MessageContentFormat.Xml ) tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Xml; else if( contentType == MessageContentFormat.Json ) tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Json; } else tbContent.CodeLanguage = NServiceBus.Profiler.Common.CodeParser.CodeLanguage.Plain; tbContent.Text = content; if( errorMsg != null ) { theGrid.RowDefinitions[1].Height = new GridLength(61); lbError.Text = errorMsg.Message; imgStackTrace.ToolTip = errorMsg.StackTrace; lbRetries.Text = errorMsg.Retries.ToString(); if( errorMsg.State == QueueItemErrorState.Retry ) { imgError.Source = WARNING_BMP; lbError.Background = WARNING_BACKGROUND; gsError.Background = WARNING_SPLITHANDLE; lbRetries.Foreground = WARNING_BACKGROUND; } else { imgError.Source = ERROR_BMP; lbError.Background = ERROR_BACKGROUND; gsError.Background = ERROR_SPLITHANDLE; lbRetries.Foreground = ERROR_BACKGROUND; } } else { theGrid.RowDefinitions[1].Height = new GridLength(0); } }