Skip to content

Commit 9243823

Browse files
committed
Renamed ViewInfo to DrawContext.
1 parent ad06a14 commit 9243823

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+484
-484
lines changed

ReClass.NET/CodeGenerator/CppCodeGenerator.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,24 @@ private class Utf8CharacterNode : BaseNode
100100
{
101101
public override int MemorySize => throw new NotImplementedException();
102102
public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException();
103-
public override Size Draw(ViewInfo view, int x, int y) => throw new NotImplementedException();
104-
public override int CalculateDrawnHeight(ViewInfo view) => throw new NotImplementedException();
103+
public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException();
104+
public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException();
105105
}
106106

107107
private class Utf16CharacterNode : BaseNode
108108
{
109109
public override int MemorySize => throw new NotImplementedException();
110110
public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException();
111-
public override Size Draw(ViewInfo view, int x, int y) => throw new NotImplementedException();
112-
public override int CalculateDrawnHeight(ViewInfo view) => throw new NotImplementedException();
111+
public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException();
112+
public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException();
113113
}
114114

115115
private class Utf32CharacterNode : BaseNode
116116
{
117117
public override int MemorySize => throw new NotImplementedException();
118118
public override void GetUserInterfaceInfo(out string name, out Image icon) => throw new NotImplementedException();
119-
public override Size Draw(ViewInfo view, int x, int y) => throw new NotImplementedException();
120-
public override int CalculateDrawnHeight(ViewInfo view) => throw new NotImplementedException();
119+
public override Size Draw(DrawContext context, int x, int y) => throw new NotImplementedException();
120+
public override int CalculateDrawnHeight(DrawContext view) => throw new NotImplementedException();
121121
}
122122

123123
#endregion

ReClass.NET/Controls/ViewInfo.cs renamed to ReClass.NET/Controls/DrawContext.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
namespace ReClassNET.Controls
88
{
9-
public class ViewInfo
9+
public class DrawContext
1010
{
1111
public Settings Settings { get; set; }
1212

13-
public Graphics Context { get; set; }
13+
public Graphics Graphics { get; set; }
1414
public FontEx Font { get; set; }
1515
public IconProvider IconProvider { get; set; }
1616

@@ -25,12 +25,12 @@ public class ViewInfo
2525
public int Level { get; set; }
2626
public bool MultipleNodesSelected { get; set; }
2727

28-
public ViewInfo Clone()
28+
public DrawContext Clone()
2929
{
30-
return new ViewInfo
30+
return new DrawContext
3131
{
3232
Settings = Settings,
33-
Context = Context,
33+
Graphics = Graphics,
3434
Font = Font,
3535
IconProvider = IconProvider,
3636
Process = Process,

ReClass.NET/Controls/MemoryPreviewPopUp.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

ReClass.NET/Controls/MemoryViewControl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ protected override void OnPaint(PaintEventArgs e)
121121
memoryPreviewPopUp.UpdateMemory();
122122
}
123123

124-
var view = new ViewInfo
124+
var view = new DrawContext
125125
{
126126
Settings = args.Settings,
127-
Context = e.Graphics,
127+
Graphics = e.Graphics,
128128
Font = font,
129129
IconProvider = args.IconProvider,
130130
Process = args.Process,

ReClass.NET/DataExchange/ReClass/Legacy/BaseClassArrayNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon)
1414
throw new NotImplementedException();
1515
}
1616

17-
public override int CalculateDrawnHeight(ViewInfo view)
17+
public override int CalculateDrawnHeight(DrawContext view)
1818
{
1919
throw new NotImplementedException();
2020
}
2121

22-
public override Size Draw(ViewInfo view, int x, int y)
22+
public override Size Draw(DrawContext context, int x, int y)
2323
{
2424
throw new NotImplementedException();
2525
}

ReClass.NET/DataExchange/ReClass/Legacy/ClassPointerNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon)
1414
throw new NotImplementedException();
1515
}
1616

17-
public override int CalculateDrawnHeight(ViewInfo view)
17+
public override int CalculateDrawnHeight(DrawContext view)
1818
{
1919
throw new NotImplementedException();
2020
}
2121

22-
public override Size Draw(ViewInfo view, int x, int y)
22+
public override Size Draw(DrawContext context, int x, int y)
2323
{
2424
throw new NotImplementedException();
2525
}

ReClass.NET/DataExchange/ReClass/Legacy/CustomNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public override void GetUserInterfaceInfo(out string name, out Image icon)
1515
throw new NotImplementedException();
1616
}
1717

18-
public override int CalculateDrawnHeight(ViewInfo view)
18+
public override int CalculateDrawnHeight(DrawContext view)
1919
{
2020
throw new NotImplementedException();
2121
}
2222

23-
public override Size Draw(ViewInfo view, int x, int y)
23+
public override Size Draw(DrawContext context, int x, int y)
2424
{
2525
throw new NotImplementedException();
2626
}

ReClass.NET/Nodes/ArrayNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public override void Initialize()
2222
ChangeInnerNode(IntPtr.Size == 4 ? (BaseNode)new Hex32Node() : new Hex64Node());
2323
}
2424

25-
public override Size Draw(ViewInfo view, int x, int y)
25+
public override Size Draw(DrawContext context, int x, int y)
2626
{
27-
return Draw(view, x, y, "Array");
27+
return Draw(context, x, y, "Array");
2828
}
2929

30-
protected override Size DrawChild(ViewInfo view, int x, int y)
30+
protected override Size DrawChild(DrawContext view, int x, int y)
3131
{
3232
var v = view.Clone();
3333
v.Address = view.Address + Offset + InnerNode.MemorySize * CurrentIndex;

ReClass.NET/Nodes/BaseFunctionNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protected class FunctionNodeInstruction
2121
protected IntPtr Address = IntPtr.Zero;
2222
protected readonly List<FunctionNodeInstruction> Instructions = new List<FunctionNodeInstruction>();
2323

24-
protected Size DrawInstructions(ViewInfo view, int tx, int y)
24+
protected Size DrawInstructions(DrawContext view, int tx, int y)
2525
{
2626
Contract.Requires(view != null);
2727

@@ -38,12 +38,12 @@ protected Size DrawInstructions(ViewInfo view, int tx, int y)
3838

3939
var x = AddText(view, tx, y, view.Settings.AddressColor, HotSpot.ReadOnlyId, instruction.Address) + 6;
4040

41-
view.Context.FillRectangle(brush, x, y, 1, view.Font.Height);
41+
view.Graphics.FillRectangle(brush, x, y, 1, view.Font.Height);
4242
x += 6;
4343

4444
x = Math.Max(AddText(view, x, y, view.Settings.HexColor, HotSpot.ReadOnlyId, instruction.Data) + 6, x + minWidth);
4545

46-
view.Context.FillRectangle(brush, x, y, 1, view.Font.Height);
46+
view.Graphics.FillRectangle(brush, x, y, 1, view.Font.Height);
4747
x += 6;
4848

4949
x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.ReadOnlyId, instruction.Instruction);

ReClass.NET/Nodes/BaseFunctionPtrNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public override string GetToolTipText(HotSpot spot)
2222
return string.Join("\n", Instructions.Select(i => i.Instruction));
2323
}
2424

25-
protected Size Draw(ViewInfo view, int x, int y, string type, string name)
25+
protected Size Draw(DrawContext view, int x, int y, string type, string name)
2626
{
2727
Contract.Requires(view != null);
2828
Contract.Requires(type != null);
@@ -92,7 +92,7 @@ protected Size Draw(ViewInfo view, int x, int y, string type, string name)
9292
return size;
9393
}
9494

95-
public override int CalculateDrawnHeight(ViewInfo view)
95+
public override int CalculateDrawnHeight(DrawContext view)
9696
{
9797
if (IsHidden)
9898
{

0 commit comments

Comments
 (0)