Move all nested eventargs out of parent classes to root

This commit is contained in:
tznind
2023-03-15 19:35:21 +00:00
parent 53597b7cec
commit 2ed71e284c
60 changed files with 983 additions and 791 deletions

View File

@@ -582,7 +582,7 @@ namespace Terminal.Gui.ApplicationTests {
int keyUps = 0;
var output = string.Empty;
Application.Top.KeyUp += (object sender, View.KeyEventEventArgs args) => {
Application.Top.KeyUp += (object sender, KeyEventEventArgs args) => {
if (args.KeyEvent.Key != (Key.CtrlMask | Key.Q)) {
output += (char)args.KeyEvent.KeyValue;
}

View File

@@ -775,7 +775,7 @@ namespace Terminal.Gui.ConfigurationTests {
ConfigurationManager.Updated += ConfigurationManager_Updated;
bool fired = false;
void ConfigurationManager_Updated (object sender, ConfigurationManager.ConfigurationManagerEventArgs obj)
void ConfigurationManager_Updated (object sender, ConfigurationManagerEventArgs obj)
{
fired = true;
// assert
@@ -801,7 +801,7 @@ namespace Terminal.Gui.ConfigurationTests {
ConfigurationManager.Reset ();
ConfigurationManager.Applied += ConfigurationManager_Applied;
bool fired = false;
void ConfigurationManager_Applied (object sender, ConfigurationManager.ConfigurationManagerEventArgs obj)
void ConfigurationManager_Applied (object sender, ConfigurationManagerEventArgs obj)
{
fired = true;
// assert

View File

@@ -1539,7 +1539,7 @@ namespace Terminal.Gui.CoreTests {
var tf = new TextField ();
tf.KeyPress += Tf_KeyPress;
void Tf_KeyPress (object sender, View.KeyEventEventArgs obj)
void Tf_KeyPress (object sender, KeyEventEventArgs obj)
{
if (obj.KeyEvent.Key == (Key.Q | Key.CtrlMask)) {
obj.Handled = tfQuiting = true;
@@ -1551,7 +1551,7 @@ namespace Terminal.Gui.CoreTests {
var top = Application.Top;
top.KeyPress += Top_KeyPress;
void Top_KeyPress (object sender, View.KeyEventEventArgs obj)
void Top_KeyPress (object sender, KeyEventEventArgs obj)
{
if (obj.KeyEvent.Key == (Key.Q | Key.CtrlMask)) {
obj.Handled = topQuiting = true;
@@ -1599,7 +1599,7 @@ namespace Terminal.Gui.CoreTests {
var tf = new TextField ();
tf.KeyPress += Tf_KeyPress;
void Tf_KeyPress (object sender, View.KeyEventEventArgs obj)
void Tf_KeyPress (object sender, KeyEventEventArgs obj)
{
if (obj.KeyEvent.Key == (Key.Q | Key.CtrlMask)) {
obj.Handled = tfQuiting = true;

View File

@@ -121,7 +121,7 @@ namespace UICatalog.Tests {
};
var token = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (ms), abortCallback);
Application.Top.KeyPress += (object sender, View.KeyEventEventArgs args) => {
Application.Top.KeyPress += (object sender, KeyEventEventArgs args) => {
Assert.Equal (Key.CtrlMask | Key.Q, args.KeyEvent.Key);
};

View File

@@ -254,7 +254,7 @@ namespace Terminal.Gui.ViewTests {
public void PositionChanged_Event ()
{
var hv = new HexView (LoadStream ()) { Width = Dim.Fill (), Height = Dim.Fill () };
HexView.HexViewEventArgs hexViewEventArgs = null;
HexViewEventArgs hexViewEventArgs = null;
hv.PositionChanged += (s, e) => hexViewEventArgs = e;
Application.Top.Add (hv);
Application.Begin (Application.Top);