mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
Refactor YesNtWindowStatements to use constructor for ownerProcess
This commit is contained in:
@@ -33,7 +33,7 @@ namespace RemSox.Utils;
|
||||
/// %win_last_id expands to the id of the last created window
|
||||
/// %ui_last_id expands to the id of the last created UI element
|
||||
/// </summary>
|
||||
public class YesNtWindowStatements
|
||||
public class YesNtWindowStatements(Process ownerProcess)
|
||||
{
|
||||
// Maps script-visible integer ids to actual Window objects.
|
||||
private readonly Dictionary<int, Window> windows = [];
|
||||
@@ -42,8 +42,6 @@ public class YesNtWindowStatements
|
||||
private int lastWindowId = 0;
|
||||
private int lastUiId = 0;
|
||||
|
||||
private Process ownerProcess = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Call this from <see cref="YesNtInterpreterProcess.Start"/> to register
|
||||
/// every window-related statement with the given interpreter.
|
||||
@@ -53,10 +51,8 @@ public class YesNtWindowStatements
|
||||
/// The <see cref="Process"/> that will own created windows
|
||||
/// (usually the <see cref="YesNtInterpreterProcess"/> itself).
|
||||
/// </param>
|
||||
public void Register(YesNtInterpreter interpreter, Process ownerProcess)
|
||||
public void Register(YesNtInterpreter interpreter)
|
||||
{
|
||||
this.ownerProcess = ownerProcess;
|
||||
|
||||
RegisterWindowStatements(interpreter);
|
||||
RegisterButtonStatement(interpreter);
|
||||
RegisterCheckBoxStatement(interpreter);
|
||||
|
||||
Reference in New Issue
Block a user