mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Removed HighlightEventArgs
This commit is contained in:
@@ -220,7 +220,7 @@ public class Border : Adornment
|
||||
|
||||
private Color? _savedForeColor;
|
||||
|
||||
private void Border_Highlight (object sender, HighlightEventArgs e)
|
||||
private void Border_Highlight (object sender, CancelEventArgs<HighlightStyle> e)
|
||||
{
|
||||
if (!Parent.Arrangement.HasFlag (ViewArrangement.Movable))
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Margin : Adornment
|
||||
}
|
||||
|
||||
private bool _pressed;
|
||||
private void Margin_Highlight (object? sender, HighlightEventArgs e)
|
||||
private void Margin_Highlight (object? sender, CancelEventArgs<HighlightStyle> e)
|
||||
{
|
||||
if (ShadowStyle != Gui.ShadowStyle.None)
|
||||
{
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Terminal.Gui;
|
||||
|
||||
/// <summary>
|
||||
/// Event arguments for the <see cref="View.Highlight"/> event.
|
||||
/// </summary>
|
||||
public class HighlightEventArgs : CancelEventArgs<HighlightStyle>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public HighlightEventArgs (ref HighlightStyle currentValue, ref HighlightStyle newValue) : base (ref currentValue, ref newValue) { }
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public partial class View
|
||||
/// Fired when the view is highlighted. Set <see cref="CancelEventArgs.Cancel"/> to <see langword="true"/>
|
||||
/// to implement a custom highlight scheme or prevent the view from being highlighted.
|
||||
/// </summary>
|
||||
public event EventHandler<HighlightEventArgs> Highlight;
|
||||
public event EventHandler<CancelEventArgs<HighlightStyle>> Highlight;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the <see cref="View"/> will be highlighted visually while the mouse button is
|
||||
@@ -211,7 +211,7 @@ public partial class View
|
||||
/// Called when the view is to be highlighted.
|
||||
/// </summary>
|
||||
/// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
|
||||
protected virtual bool? OnHighlight (HighlightEventArgs args)
|
||||
protected virtual bool? OnHighlight (CancelEventArgs<HighlightStyle> args)
|
||||
{
|
||||
Highlight?.Invoke (this, args);
|
||||
|
||||
@@ -442,7 +442,7 @@ public partial class View
|
||||
|
||||
// Enable override via virtual method and/or event
|
||||
HighlightStyle copy = HighlightStyle;
|
||||
var args = new HighlightEventArgs (ref copy, ref newHighlightStyle);
|
||||
var args = new CancelEventArgs<HighlightStyle> (ref copy, ref newHighlightStyle);
|
||||
|
||||
if (OnHighlight (args) == true)
|
||||
{
|
||||
|
||||
@@ -295,7 +295,7 @@ public class Shortcut : View
|
||||
|
||||
private Color? _savedForeColor;
|
||||
|
||||
private void Shortcut_Highlight (object sender, HighlightEventArgs e)
|
||||
private void Shortcut_Highlight (object sender, CancelEventArgs<HighlightStyle> e)
|
||||
{
|
||||
if (e.CurrentValue.HasFlag (HighlightStyle.Pressed))
|
||||
{
|
||||
|
||||
@@ -566,7 +566,7 @@ public class MouseTests (ITestOutputHelper output) : TestsAllViews
|
||||
|
||||
return;
|
||||
|
||||
void View_Highlight (object sender, HighlightEventArgs e)
|
||||
void View_Highlight (object sender, CancelEventArgs<HighlightStyle> e)
|
||||
{
|
||||
if (e.NewValue == HighlightStyle.None)
|
||||
{
|
||||
@@ -635,7 +635,7 @@ public class MouseTests (ITestOutputHelper output) : TestsAllViews
|
||||
|
||||
return;
|
||||
|
||||
void View_Highlight (object sender, HighlightEventArgs e)
|
||||
void View_Highlight (object sender, CancelEventArgs<HighlightStyle> e)
|
||||
{
|
||||
if (e.NewValue == HighlightStyle.None)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user