예제 #1
0
 public HexLineTextSource(HexLine hexLine)
 {
     this.hexLine = hexLine;
 }
예제 #2
0
파일: HexBox.cs 프로젝트: lovebanyi/dnSpy
 void InitializeFontProperties()
 {
     var textRunProps = CreateHexTextRunProperties();
     var paraProps = CreateHexTextParagraphProperties(textRunProps);
     var hexLine = new HexLine(0, 0, "O", new HexLinePart[1] { new HexLinePart(0, 1, textRunProps) });
     var hexLineTextSource = new HexLineTextSource(hexLine);
     using (var textLine = textFormatter.FormatLine(hexLineTextSource, 0, 10000, paraProps, null)) {
         characterWidth = textLine.Width;
         characterHeight = textLine.Height;
     }
 }
예제 #3
0
파일: HexBox.cs 프로젝트: lovebanyi/dnSpy
        bool CompareBytes(HexLine line)
        {
            // Assume it's been modified if the array is null. It'll be null if CacheLineBytes
            // was false, the HexLine was created, then CacheLineBytes was set to true.
            if (line.OriginalBytes == null)
                return false;

            var doc = Document;
            if (doc == null)
                return false;

            int i = 0;
            for (ulong addr = line.StartOffset; addr <= line.EndOffset && i < line.OriginalBytes.Length; addr++, i++) {
                int b = doc.ReadByte(addr);
                if (line.OriginalBytes[i] != b)
                    return false;
            }

            return true;
        }
예제 #4
0
파일: HexBox.cs 프로젝트: lovebanyi/dnSpy
 Rect GetCharacterRect(HexLine hexLine, double y, int column)
 {
     return new Rect(column * characterWidth, y, characterWidth, characterHeight);
 }
예제 #5
0
 public HexLineTextSource(HexLine hexLine)
 {
     this.hexLine = hexLine;
 }