@@ -23,7 +23,7 @@ private class MemoryPreviewPanel : Panel
2323 {
2424 private const int MinNodeCount = 10 ;
2525
26- public ViewInfo ViewInfo { get ; }
26+ public DrawContext DrawContext { get ; }
2727
2828 private readonly List < BaseHexNode > nodes ;
2929
@@ -35,7 +35,7 @@ public MemoryPreviewPanel(FontEx font)
3535
3636 nodes = new List < BaseHexNode > ( ) ;
3737
38- ViewInfo = new ViewInfo
38+ DrawContext = new DrawContext
3939 {
4040 Font = font ,
4141
@@ -75,7 +75,7 @@ BaseHexNode CreateNode(int index)
7575 nodes . RemoveRange ( count , nodes . Count - count ) ;
7676 }
7777
78- ViewInfo . Memory . Size = nodes . Select ( n => n . MemorySize ) . Sum ( ) ;
78+ DrawContext . Memory . Size = nodes . Select ( n => n . MemorySize ) . Sum ( ) ;
7979 }
8080
8181 /// <summary>Changes the number of nodes with the provided delta.</summary>
@@ -100,29 +100,29 @@ private void CalculateSize()
100100 {
101101 var size = new Size (
102102 ToolTipWidth ,
103- nodes . Sum ( n => n . CalculateDrawnHeight ( ViewInfo ) ) + ToolTipPadding
103+ nodes . Sum ( n => n . CalculateDrawnHeight ( DrawContext ) ) + ToolTipPadding
104104 ) ;
105105
106- ViewInfo . ClientArea = new Rectangle ( ToolTipPadding / 2 , ToolTipPadding / 2 , size . Width - ToolTipPadding , size . Height - ToolTipPadding ) ;
106+ DrawContext . ClientArea = new Rectangle ( ToolTipPadding / 2 , ToolTipPadding / 2 , size . Width - ToolTipPadding , size . Height - ToolTipPadding ) ;
107107
108108 Size = MinimumSize = MaximumSize = size ;
109109 }
110110
111111 protected override void OnPaint ( PaintEventArgs e )
112112 {
113- ViewInfo . HotSpots . Clear ( ) ;
113+ DrawContext . HotSpots . Clear ( ) ;
114114
115115 // Some settings are not usefull for the preview.
116- ViewInfo . Settings = Program . Settings . Clone ( ) ;
117- ViewInfo . Settings . ShowNodeAddress = false ;
116+ DrawContext . Settings = Program . Settings . Clone ( ) ;
117+ DrawContext . Settings . ShowNodeAddress = false ;
118118
119- ViewInfo . Context = e . Graphics ;
119+ DrawContext . Graphics = e . Graphics ;
120120
121- using ( var brush = new SolidBrush ( ViewInfo . Settings . BackgroundColor ) )
121+ using ( var brush = new SolidBrush ( DrawContext . Settings . BackgroundColor ) )
122122 {
123123 e . Graphics . FillRectangle ( brush , ClientRectangle ) ;
124124 }
125- using ( var pen = new Pen ( ViewInfo . Settings . BackgroundColor . Invert ( ) , 1 ) )
125+ using ( var pen = new Pen ( DrawContext . Settings . BackgroundColor . Invert ( ) , 1 ) )
126126 {
127127 e . Graphics . DrawRectangle ( pen , new Rectangle ( Bounds . X , Bounds . Y , Bounds . Width - 1 , Bounds . Height - 1 ) ) ;
128128 }
@@ -131,7 +131,7 @@ protected override void OnPaint(PaintEventArgs e)
131131 int y = 2 ;
132132 foreach ( var node in nodes )
133133 {
134- y += node . Draw ( ViewInfo , x , y ) . Height ;
134+ y += node . Draw ( DrawContext , x , y ) . Height ;
135135 }
136136 }
137137 }
@@ -213,15 +213,15 @@ public void InitializeMemory(RemoteProcess process, IntPtr address)
213213
214214 memoryAddress = address ;
215215
216- panel . ViewInfo . Process = process ;
216+ panel . DrawContext . Process = process ;
217217
218- panel . ViewInfo . Memory . UpdateFrom ( process , address ) ;
218+ panel . DrawContext . Memory . UpdateFrom ( process , address ) ;
219219 }
220220
221221 /// <summary>Updates the memory buffer to get current data.</summary>
222222 public void UpdateMemory ( )
223223 {
224- panel . ViewInfo . Memory . UpdateFrom ( panel . ViewInfo . Process , memoryAddress ) ;
224+ panel . DrawContext . Memory . UpdateFrom ( panel . DrawContext . Process , memoryAddress ) ;
225225
226226 panel . Invalidate ( ) ;
227227 }
0 commit comments