public static string DumpPacket(EthernetFrame packet, bool isSend, Machine machine) { var builder = new StringBuilder(); string machName; if (!EmulationManager.Instance.CurrentEmulation.TryGetMachineName(machine, out machName)) { //probably the emulation is closing now, just return. return(string.Empty); } if (isSend) { builder.AppendLine(String.Format("Sending packet from {0}, length: {1}", machName, packet.Bytes.Length)); } else { builder.AppendLine(String.Format("Receiving packet on {0}, length: {1}", machName, packet.Bytes.Length)); } builder.Append(packet.ToString()); return(builder.ToString()); }