1
1
using System ;
2
2
using System . Data ;
3
+ using System . Diagnostics . Contracts ;
3
4
using System . Drawing ;
4
5
using System . IO ;
5
6
using System . Linq ;
@@ -13,11 +14,17 @@ namespace ReClassNET.Forms
13
14
{
14
15
public partial class ProcessInfoForm : IconForm
15
16
{
17
+ private readonly RemoteProcess process ;
18
+
16
19
/// <summary>The context menu of the sections grid view.</summary>
17
20
public ContextMenuStrip GridContextMenu => contextMenuStrip ;
18
21
19
- public ProcessInfoForm ( )
22
+ public ProcessInfoForm ( RemoteProcess process )
20
23
{
24
+ Contract . Requires ( process != null ) ;
25
+
26
+ this . process = process ;
27
+
21
28
InitializeComponent ( ) ;
22
29
23
30
tabControl . ImageList = new ImageList ( ) ;
@@ -54,7 +61,7 @@ protected override void OnFormClosed(FormClosedEventArgs e)
54
61
55
62
private async void ProcessInfoForm_Load ( object sender , EventArgs e )
56
63
{
57
- if ( ! Program . RemoteProcess . IsValid )
64
+ if ( ! process . IsValid )
58
65
{
59
66
return ;
60
67
}
@@ -78,7 +85,7 @@ private async void ProcessInfoForm_Load(object sender, EventArgs e)
78
85
79
86
await Task . Run ( ( ) =>
80
87
{
81
- Program . RemoteProcess . EnumerateRemoteSectionsAndModules (
88
+ process . EnumerateRemoteSectionsAndModules (
82
89
delegate ( Section section )
83
90
{
84
91
var row = sections . NewRow ( ) ;
@@ -180,7 +187,7 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e)
180
187
181
188
if ( sfd . ShowDialog ( ) == DialogResult . OK )
182
189
{
183
- var dumper = new Dumper ( Program . RemoteProcess ) ;
190
+ var dumper = new Dumper ( process ) ;
184
191
185
192
try
186
193
{
0 commit comments