private static void writeStatus(RichTextBox rtfStatus, Color statusColor, StatusArgs statusArgs) { rtfStatus.SelectionColor = statusColor; rtfStatus.AppendText(statusArgs.Category.ToString()); rtfStatus.SelectionColor = Color.Black; rtfStatus.AppendText(": " + statusArgs.Text + "\r\n"); }
public static void WriteRtfStatusArgsLine(RichTextBox rtfStatus, StatusArgs statusArgs) { switch (statusArgs.Type & StatusType._MASK) { case StatusType.Info: writeStatus(rtfStatus, Color.MediumBlue, statusArgs); break; case StatusType.Success: writeStatus(rtfStatus, Color.DarkGreen, statusArgs); break; case StatusType.Warning: writeStatus(rtfStatus, Color.DarkOrange, statusArgs); break; case StatusType.Error: writeStatus(rtfStatus, Color.DarkRed, statusArgs); break; default: writeStatus(rtfStatus, Color.DeepPink, statusArgs); break; } }
private void StatusEvent(object sender, StatusArgs e) { if (IsDisposed) { LoggingEnabled = false; return; } if (!mLoggingEnabled) { return; } if (InvokeRequired) { Invoke(new StatusEventDelegate(StatusEvent), new object[] { sender, e }); return; } lock (mRtfTextLock) { if (!ReferenceEquals(mStatusFilterDelegate, null)) { if (mStatusFilterDelegate(e)) { InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e); } } else { InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e); } } }
private static bool RemoveStatusFilter(StatusArgs statusargs) { if (statusargs.Category == CategoryType.EnumerateDevices) { return(false); } return(true); }
internal static StatusArgs Log(CategoryType category, StatusType statusType, string fmt, params object[] args) { StatusArgs statusArgs = new StatusArgs(category, statusType, fmt, args); lock (mLogLock) { return(Log(statusArgs)); } }
internal static StatusArgs Log(StatusArgs statusArgs) { EventHandler <StatusArgs> temp = StatusEvent; if (!ReferenceEquals(temp, null)) { temp(null, statusArgs); } if (DebugStatusOnlyMask == 0) { Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString()); } else { if ((statusArgs.Type & DebugStatusOnlyMask) > 0) { Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString()); } } return(statusArgs); }
internal static StatusArgs Log(CategoryType category, StatusType statusType, string statusText) { StatusArgs statusArgs = new StatusArgs(category, statusType, statusText); return(Log(statusArgs)); }
internal static StatusArgs Log(CategoryType category, StatusType statusType, string fmt, params object[] args) { StatusArgs statusArgs = new StatusArgs(category, statusType, fmt, args); lock (mLogLock) { return Log(statusArgs); } }
internal static StatusArgs Log(CategoryType category, StatusType statusType, string statusText) { StatusArgs statusArgs = new StatusArgs(category, statusType, statusText); return Log(statusArgs); }
internal static StatusArgs Log(StatusArgs statusArgs) { EventHandler<StatusArgs> temp = StatusEvent; if (!ReferenceEquals(temp, null)) temp(null, statusArgs); if (DebugStatusOnlyMask==0) Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString()); else { if ((statusArgs.Type & DebugStatusOnlyMask) > 0) { Debug.WriteLine("[" + statusArgs.Type + "] " + statusArgs.Text, statusArgs.Category.ToString()); } } return statusArgs; }
private static bool RemoveStatusFilter(StatusArgs statusargs) { if (statusargs.Category == CategoryType.EnumerateDevices) return false; return true; }
private void StatusEvent(object sender, StatusArgs e) { if (IsDisposed) { LoggingEnabled = false; return; } if (!mLoggingEnabled) return; if (InvokeRequired) { Invoke(new StatusEventDelegate(StatusEvent), new object[] {sender, e}); return; } lock (mRtfTextLock) { if (!ReferenceEquals(mStatusFilterDelegate,null)) { if (mStatusFilterDelegate(e)) InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e); } else InfWizardStatus.WriteRtfStatusArgsLine(rtfSatus, e); } }