11using System ;
22using System . Data ;
3+ using System . Diagnostics . Contracts ;
34using System . Drawing ;
45using System . IO ;
56using System . Linq ;
@@ -13,11 +14,17 @@ namespace ReClassNET.Forms
1314{
1415 public partial class ProcessInfoForm : IconForm
1516 {
17+ private readonly RemoteProcess process ;
18+
1619 /// <summary>The context menu of the sections grid view.</summary>
1720 public ContextMenuStrip GridContextMenu => contextMenuStrip ;
1821
19- public ProcessInfoForm ( )
22+ public ProcessInfoForm ( RemoteProcess process )
2023 {
24+ Contract . Requires ( process != null ) ;
25+
26+ this . process = process ;
27+
2128 InitializeComponent ( ) ;
2229
2330 tabControl . ImageList = new ImageList ( ) ;
@@ -54,7 +61,7 @@ protected override void OnFormClosed(FormClosedEventArgs e)
5461
5562 private async void ProcessInfoForm_Load ( object sender , EventArgs e )
5663 {
57- if ( ! Program . RemoteProcess . IsValid )
64+ if ( ! process . IsValid )
5865 {
5966 return ;
6067 }
@@ -78,7 +85,7 @@ private async void ProcessInfoForm_Load(object sender, EventArgs e)
7885
7986 await Task . Run ( ( ) =>
8087 {
81- Program . RemoteProcess . EnumerateRemoteSectionsAndModules (
88+ process . EnumerateRemoteSectionsAndModules (
8289 delegate ( Section section )
8390 {
8491 var row = sections . NewRow ( ) ;
@@ -180,7 +187,7 @@ private void dumpToolStripMenuItem_Click(object sender, EventArgs e)
180187
181188 if ( sfd . ShowDialog ( ) == DialogResult . OK )
182189 {
183- var dumper = new Dumper ( Program . RemoteProcess ) ;
190+ var dumper = new Dumper ( process ) ;
184191
185192 try
186193 {
0 commit comments