From 89f264ad864870e5602c7b5a7ccf2b458d1d7e11 Mon Sep 17 00:00:00 2001 From: sancheolz Date: Mon, 4 Mar 2019 17:31:59 +0300 Subject: [PATCH] [SWF] Method OnClosed should pass FormClosedEventArgs type, instead of EventArgs.Empty (#13283) Fixes #13282 --- mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs | 5 +++-- .../Test/System.Windows.Forms/MdiFormTest.cs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs index 419564b99bc4b..b662768c8c358 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs @@ -157,8 +157,9 @@ internal bool FireClosingEvents (CloseReason reason, bool cancel) // Convenience method for fire BOTH OnClosed and OnFormClosed events private void FireClosedEvents (CloseReason reason) { - this.OnClosed (EventArgs.Empty); - this.OnFormClosed (new FormClosedEventArgs (reason)); + FormClosedEventArgs fc = new FormClosedEventArgs(reason); + this.OnClosed (fc); + this.OnFormClosed (fc); } [EditorBrowsable (EditorBrowsableState.Advanced)] diff --git a/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs b/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs index 017d9fe732e78..034f7e61df17f 100644 --- a/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs +++ b/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs @@ -260,6 +260,7 @@ void ChildForm_Closing (object sender, CancelEventArgs e) void ChildForm_Closed (object sender, EventArgs e) { + Assert.IsNotNull ((FormClosedEventArgs)e, "FormClosedEventArgs"); Assert.IsNotNull (MdiParent, "ChildForm_Closed"); }