/// <summary> /// Displays a break between groups of text /// </summary> public static void OutBreak() { if (s_bLastMessageBreak) { return; } try { const SledMessageType messageType = SledMessageType.Info; if (s_bOutDeviceReady) { s_instance.m_writer.Write(s_dictMsgTypeLookup[messageType], Break); } else { s_lstMessages.Add(new QueuedMessage(false, messageType, Break)); } } finally { s_bLastMessageBreak = true; } }
public static void OutLineDebug(SledMessageType messageType, string format, params object[] args) { try { var formatted = args.Length <= 0 ? format : string.Format(format, args); if (s_bOutDeviceReady) { s_instance.m_writer.Write(s_dictMsgTypeLookup[messageType], formatted + Environment.NewLine); } else { s_lstMessages.Add(new QueuedMessage(false, messageType, formatted)); } } catch (Exception ex) { if ((s_instance != null) && (s_instance.m_writer != null)) { s_instance.m_writer.Write(OutputMessageType.Error, "SledOutDeviceDebug Exception: {0}", ex.Message); } } finally { s_bLastMessageBreak = false; } }
/// <summary> /// Constructor /// </summary> /// <param name="type">Message type</param> /// <param name="format">Format string</param> /// <param name="args">Parameters</param> public ScopedDebugOnlyOutput(SledMessageType type, string format, params object[] args) { m_type = type; m_message = string.Format(format, args); Output(m_type, m_message); }
/// <summary> /// Constructor with parameters /// </summary> /// <param name="messageType">Message type</param> /// <param name="format">Optional text to display</param> /// <param name="args">Optional parameters</param> public OutlineWrapper(SledMessageType messageType, string format, params object[] args) { m_timer = new SledHiPerfTimer(); m_timer.Start(); m_message = string.Format(format, args); m_messageType = messageType; }
public static void OutDebug(SledMessageType messageType, string format, params object[] args) { try { var formatted = string.Format(format, args); if (s_bOutDeviceReady) { s_instance.m_writer.Write(s_dictMsgTypeLookup[messageType], formatted); } else { s_lstMessages.Add(new QueuedMessage(true, messageType, formatted)); } } finally { s_bLastMessageBreak = false; } }
/// <summary> /// Write a list of items to the Output window with each item on a new line /// </summary> /// <typeparam name="T">Type of item to output</typeparam> /// <param name="messageType">Message type</param> /// <param name="prefix">String to prepend to each line</param> /// <param name="lstItems">List of items to write</param> public static void OutLineList <T>(SledMessageType messageType, string prefix, IEnumerable <T> lstItems) where T : class { if (lstItems == null) { return; } foreach (var item in lstItems) { var itemString = item == null ? string.Empty : item.ToString(); var message = string.IsNullOrEmpty(prefix) ? string.Format("{0}", itemString) : string.Format("{0} {1}", prefix, itemString); OutLine(messageType, message); } }
/// <summary> /// Constructor /// </summary> /// <param name="messageType">SledMessageType</param> /// <param name="message">Message text</param> public SledTtyMessage(SledMessageType messageType, string message) : this(message) { m_messageType = messageType; }
public QueuedMessage(bool bOutOrOutLine, SledMessageType messageType, string message) { OutOrOutLine = bOutOrOutLine; MessageType = messageType; Message = message; }
/// <summary> /// Constructor with parameters /// </summary> /// <param name="messageType">Message type</param> /// <param name="format">Optional text to display</param> /// <param name="args">Optional parameters</param> public OutlineWrapper(SledMessageType messageType, string format, params object[] args) { m_timer = new SledHiPerfTimer(); m_timer.Start(); m_message = string.Format(format, args); m_messageType = messageType; }
/// <summary> /// Constructor /// </summary> /// <param name="messageType">SledMessageType</param> /// <param name="message">Message text</param> public SledTtyMessage(SledMessageType messageType, string message) : this(message) { m_messageType = messageType; }
private static void Output(SledMessageType type, string message) { SledOutDevice.OutLine(type, message); }