public static void _DLOG_List(this string format, IEnumerable list, params object[] args) { if (list != null) { foreach (var item in list) { if (args != null && args.Length > 0) { object[] newargs = new object[args.Length + 1]; Array.Copy(args, 0, newargs, 1, args.Length); newargs[0] = item.ToString(); Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, newargs), true, true, 2, 1); } else { Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, item.ToString()), true, true, 2, 1); } } } else { if (args != null && args.Length > 0) { object[] newargs = new object[args.Length + 1]; Array.Copy(args, 0, newargs, 1, args.Length); newargs[0] = "NULL"; Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, newargs), true, true, 2, 1); } else { Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, "NULL"), true, true, 2, 1); } } }
public static void _DLOG(this string format, params object[] args) { string text = null; try { text = Tools.FormatStr(format, args); } catch (ArgumentNullException) { text = "-- -- --"; } catch (FormatException) { text = "-- -- --"; } try { Tools._writeDebugDiagnosticMessage(text, true, true, 3, 4); } catch (Exception ex) { throw new ApplicationException("Unhandled:" + ex.Message); } }
public override string ToString() { string ret = "*_"; switch (Presence) { case Presence.Value: if (MaskInData == 0xFF) { ret = Tools.FormatStr("{0:X2}", Value); } else { ret = Tools.FormatStr("{0:X2}&{1:X2}", Value, MaskInData); } break; case Presence.ExceptValue: if (MaskInData == 0xFF) { ret = Tools.FormatStr("!{0:X2}", Value); } else { ret = Tools.FormatStr("!{0:X2}&{1:X2}", Value, MaskInData); } break; case Presence.AnyValue: ret = "__"; break; } return(ret); }
public static string FormatStr(this string format, params object[] args) { return(Tools.FormatStr(format, args)); }
public static void _EXLOG(this string format, params object[] args) { Tools._writeDebugDiagnosticExceptionMessage(Tools.FormatStr(format, args)); }