public static byte[] GetLogEntryBytes(BalloonLogEntry.Type type, int arg1, long arg2) { return(BitConverter.GetBytes(DateTime.UtcNow.Ticks) .Concat(BitConverter.GetBytes((int)type)) .Concat(BitConverter.GetBytes(arg1)) .Concat(BitConverter.GetBytes(arg2)).ToArray()); }
public static void Add(BalloonLogEntry.Type type, int arg1, long arg2) { try { if (instance != null && instance.writeLogStream != null) { var logBytes = GetLogEntryBytes(type, arg1, arg2); instance.writeLogStream.Write(logBytes, 0, logBytes.Length); if (instance.logViewer != null) { instance.logViewer.Refresh(); } } } catch { } }