private void CreateHexParts()
        {
            var columnNumber = 0;
            var lineNumber = 1;
            var hexLine = new HexPart(lineNumber);

            foreach (var currentByte in CurrentContent)
            {
                if(!HexParts.Contains(hexLine))
                    HexParts.Add(hexLine);

                var hexChar = new HexNumber();

                AppendHex(hexChar, currentByte);
                AppendText(hexChar, currentByte);

                hexLine.Numbers.Add(hexChar);
                columnNumber++;

                if (columnNumber == 16)
                {
                    lineNumber++;
                    columnNumber = 0;
                    hexLine = new HexPart(lineNumber);
                }
            }
        }
Ejemplo n.º 2
0
        private void CreateHexParts()
        {
            var columnNumber = 0;
            var lineNumber   = 1;
            var hexLine      = new HexPart(lineNumber);

            foreach (var currentByte in SelectedMessage)
            {
                if (!HexParts.Contains(hexLine))
                {
                    HexParts.Add(hexLine);
                }

                var hexChar = new HexNumber();

                AppendHex(hexChar, currentByte);
                AppendText(hexChar, currentByte);

                hexLine.Numbers.Add(hexChar);
                columnNumber++;

                if (columnNumber == 16)
                {
                    lineNumber++;
                    columnNumber = 0;
                    hexLine      = new HexPart(lineNumber);
                }
            }
        }
 private static void AppendText(HexNumber number, byte b)
 {
     var c = ByteToStringConverter.TryGetValue(b, " ");
     if (c == "\r" || c == "\n" || c == "\t")
     {
         number.Text = ".";
     }
     else
     {
         number.Text = c;
     }
 }
Ejemplo n.º 4
0
        private static void AppendText(HexNumber number, byte b)
        {
            var c = ByteToStringConverter.TryGetValue(b, " ");

            if (c == "\r" || c == "\n" || c == "\t")
            {
                number.Text = ".";
            }
            else
            {
                number.Text = c;
            }
        }
 private static void AppendHex(HexNumber hexValue, byte b)
 {
     hexValue.Hex = string.Format(b < 0x10 ? "0{0:X000} " : "{0:X000} ", b);
 }
Ejemplo n.º 6
0
 private static void AppendHex(HexNumber hexValue, byte b)
 {
     hexValue.Hex = string.Format(b < 0x10 ? "0{0:X000} " : "{0:X000} ", b);
 }