mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 01:38:01 +01:00
Standardize on EventHandler
This commit is contained in:
@@ -131,7 +131,7 @@ namespace Terminal.Gui {
|
||||
}
|
||||
}
|
||||
|
||||
void Border_BorderChanged (Border border)
|
||||
void Border_BorderChanged (object sender, EventArgs e)
|
||||
{
|
||||
Rect frame;
|
||||
if (Border.Child != null && (Border.Child.Width is Dim || Border.Child.Height is Dim)) {
|
||||
@@ -319,7 +319,7 @@ namespace Terminal.Gui {
|
||||
/// <summary>
|
||||
/// Invoked when any property of Border changes (except <see cref="Child"/>).
|
||||
/// </summary>
|
||||
public event Action<Border> BorderChanged;
|
||||
public event EventHandler BorderChanged;
|
||||
|
||||
private BorderStyle borderStyle;
|
||||
private bool drawMarginFrame;
|
||||
@@ -1113,7 +1113,7 @@ namespace Terminal.Gui {
|
||||
/// </summary>
|
||||
public virtual void OnBorderChanged ()
|
||||
{
|
||||
BorderChanged?.Invoke (this);
|
||||
BorderChanged?.Invoke (this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ namespace Terminal.Gui {
|
||||
/// <summary>
|
||||
/// Event arguments for the <see cref="CollectionNavigator.SearchStringChanged"/> event.
|
||||
/// </summary>
|
||||
public class KeystrokeNavigatorEventArgs {
|
||||
public class KeystrokeNavigatorEventArgs : EventArgs{
|
||||
/// <summary>
|
||||
/// he current <see cref="SearchString"/>.
|
||||
/// </summary>
|
||||
@@ -66,7 +66,7 @@ namespace Terminal.Gui {
|
||||
/// <summary>
|
||||
/// This event is invoked when <see cref="SearchString"/> changes. Useful for debugging.
|
||||
/// </summary>
|
||||
public event Action<KeystrokeNavigatorEventArgs> SearchStringChanged;
|
||||
public event EventHandler<KeystrokeNavigatorEventArgs> SearchStringChanged;
|
||||
|
||||
private string _searchString = "";
|
||||
/// <summary>
|
||||
@@ -87,7 +87,7 @@ namespace Terminal.Gui {
|
||||
/// <param name="e"></param>
|
||||
public virtual void OnSearchStringChanged (KeystrokeNavigatorEventArgs e)
|
||||
{
|
||||
SearchStringChanged?.Invoke (e);
|
||||
SearchStringChanged?.Invoke (this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Terminal.Gui {
|
||||
}
|
||||
}
|
||||
|
||||
void Border_BorderChanged (Border border)
|
||||
void Border_BorderChanged (object sender, EventArgs e)
|
||||
{
|
||||
Rect frame;
|
||||
if (contentView != null && (contentView.Width is Dim || contentView.Height is Dim)) {
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Terminal.Gui {
|
||||
}
|
||||
}
|
||||
|
||||
void Border_BorderChanged (Border border)
|
||||
void Border_BorderChanged (object sender, EventArgs e)
|
||||
{
|
||||
Rect frame;
|
||||
if (contentView != null && (contentView.Width is Dim || contentView.Height is Dim)) {
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Terminal.Gui {
|
||||
Child.Initialized -= Child_Initialized;
|
||||
}
|
||||
|
||||
private void Border_BorderChanged (Border obj)
|
||||
private void Border_BorderChanged (object sender, EventArgs e)
|
||||
{
|
||||
AdjustContainer ();
|
||||
}
|
||||
|
||||
@@ -142,8 +142,8 @@ namespace UICatalog.Scenarios {
|
||||
|
||||
_listView.SetSource (_items);
|
||||
|
||||
_listView.KeystrokeNavigator.SearchStringChanged += (state) => {
|
||||
label.Text = $"ListView: {state.SearchString}";
|
||||
_listView.KeystrokeNavigator.SearchStringChanged += (s,e) => {
|
||||
label.Text = $"ListView: {e.SearchString}";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -179,8 +179,8 @@ namespace UICatalog.Scenarios {
|
||||
_treeView.ExpandAll ();
|
||||
_treeView.GoToFirst ();
|
||||
|
||||
_treeView.KeystrokeNavigator.SearchStringChanged += (state) => {
|
||||
label.Text = $"TreeView: {state.SearchString}";
|
||||
_treeView.KeystrokeNavigator.SearchStringChanged += (s,e) => {
|
||||
label.Text = $"TreeView: {e.SearchString}";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user