public SelectedPacketDesc(SelectedPacketLine p) : this()
        {
            DataTypeName.Content = p.packetType;
            var name = "(" + p.packetName + "): ";

            switch (p.packetType)
            {
            case "b":     //byte
                name += byte.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
                break;

            case "s":     //short
                name += short.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
                break;

            case "d":     //int
                name += int.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
                break;

            case "l":     //long
                name += long.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
                break;

            case "f":     //float
                name += float.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
                break;

            case "str":     //string
            case "unk":
                FieldName.Content = p.Content.Content;
                break;
            }
            FieldName.Content = name;
        }
        private void appendString(string s, string type, string fieldName)
        {
            var line = new SelectedPacketLine(type, fieldName);

            line.Content.Content = s;
            Content.Items.Add(line);
        }
 public SelectedPacketDesc(SelectedPacketLine p) : this()
 {
     DataTypeName.Content = p.packetType;
     var name = "(" + p.packetName + "): ";
     switch (p.packetType)
     {
         case "b": //byte
             name += byte.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
             break;
         case "s": //short
             name += short.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
             break;
         case "d": //int
             name += int.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
             break;
         case "l": //long
             name += long.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
             break;
         case "f": //float
             name += float.Parse(p.Content.Content.ToString(), System.Globalization.NumberStyles.HexNumber);
             break;
         case "str": //string
         case "unk":
             FieldName.Content = p.Content.Content;
             break;
     }
     FieldName.Content = name;
 }
        private void appendHex(string[] hex, string type, string fieldName)
        {
            var line = new SelectedPacketLine(type, fieldName);
            var cont = "";

            foreach (var h in hex)
            {
                cont += h + " ";
            }
            line.Content.Content = cont;
            Content.Items.Add(line);
        }
        private void appendBytes(byte[] bytes, string type, string fieldName)
        {
            var line = new SelectedPacketLine(type, fieldName);
            var cont = "";

            foreach (var b in bytes)
            {
                cont += b.ToString("X2") + " ";
            }
            line.Content.Content = cont;
            Content.Items.Add(line);
        }
 private void appendHex(string[] hex, string type, string fieldName)
 {
     var line = new SelectedPacketLine(type, fieldName);
     var cont = "";
     foreach (var h in hex)
         cont += h + " ";
     line.Content.Content = cont;
     Content.Items.Add(line);
 }
 private void appendString(string s, string type, string fieldName)
 {
     var line = new SelectedPacketLine(type, fieldName);
     line.Content.Content = s;
     Content.Items.Add(line);
 }
 private void appendBytes(byte[] bytes, string type, string fieldName)
 {
     var line = new SelectedPacketLine(type, fieldName);
     var cont = "";
     foreach (var b in bytes)
         cont += b.ToString("X2") + " ";
     line.Content.Content = cont;
     Content.Items.Add(line);
 }