diff --git a/Terminal.Gui/Views/DateField.cs b/Terminal.Gui/Views/DateField.cs index 3093eb59f..d88648a41 100644 --- a/Terminal.Gui/Views/DateField.cs +++ b/Terminal.Gui/Views/DateField.cs @@ -38,7 +38,7 @@ namespace Terminal.Gui { /// /// The passed event arguments containing the old value, new value, and format string. /// - public event Action> DateChanged; + public event EventHandler> DateChanged; /// /// Initializes a new instance of using layout. @@ -418,7 +418,7 @@ namespace Terminal.Gui { /// Event arguments public virtual void OnDateChanged (DateTimeEventArgs args) { - DateChanged?.Invoke (args); + DateChanged?.Invoke (this,args); } } diff --git a/Terminal.Gui/Views/RadioGroup.cs b/Terminal.Gui/Views/RadioGroup.cs index aaa510abf..474baebc1 100644 --- a/Terminal.Gui/Views/RadioGroup.cs +++ b/Terminal.Gui/Views/RadioGroup.cs @@ -265,7 +265,7 @@ namespace Terminal.Gui { /// /// Invoked when the selected radio label has changed. /// - public event Action SelectedItemChanged; + public event EventHandler SelectedItemChanged; /// /// The currently selected item from the list of radio labels @@ -296,7 +296,7 @@ namespace Terminal.Gui { public virtual void OnSelectedItemChanged (int selectedItem, int previousSelectedItem) { selected = selectedItem; - SelectedItemChanged?.Invoke (new SelectedItemChangedArgs (selectedItem, previousSelectedItem)); + SelectedItemChanged?.Invoke (this, new SelectedItemChangedArgs (selectedItem, previousSelectedItem)); } /// diff --git a/Terminal.Gui/Views/ScrollBarView.cs b/Terminal.Gui/Views/ScrollBarView.cs index 6870e0848..991a3675d 100644 --- a/Terminal.Gui/Views/ScrollBarView.cs +++ b/Terminal.Gui/Views/ScrollBarView.cs @@ -199,7 +199,7 @@ namespace Terminal.Gui { /// /// This event is raised when the position on the scrollbar has changed. /// - public event Action ChangedPosition; + public event EventHandler ChangedPosition; /// /// The position, relative to , to set the scrollbar at. @@ -312,7 +312,7 @@ namespace Terminal.Gui { /// public virtual void OnChangedPosition () { - ChangedPosition?.Invoke (); + ChangedPosition?.Invoke (this, EventArgs.Empty); } /// diff --git a/Terminal.Gui/Views/TableView.cs b/Terminal.Gui/Views/TableView.cs index c1647437b..6ea192531 100644 --- a/Terminal.Gui/Views/TableView.cs +++ b/Terminal.Gui/Views/TableView.cs @@ -171,12 +171,12 @@ namespace Terminal.Gui { /// /// This event is raised when the selected cell in the table changes. /// - public event Action SelectedCellChanged; + public event EventHandler SelectedCellChanged; /// /// This event is raised when a cell is activated e.g. by double clicking or pressing /// - public event Action CellActivated; + public event EventHandler CellActivated; /// /// The key which when pressed should trigger event. Defaults to Enter. @@ -1510,7 +1510,7 @@ namespace Terminal.Gui { /// protected virtual void OnSelectedCellChanged (SelectedCellChangedEventArgs args) { - SelectedCellChanged?.Invoke (args); + SelectedCellChanged?.Invoke (this,args); } /// @@ -1519,7 +1519,7 @@ namespace Terminal.Gui { /// protected virtual void OnCellActivated (CellActivatedEventArgs args) { - CellActivated?.Invoke (args); + CellActivated?.Invoke (this, args); } /// diff --git a/Terminal.Gui/Views/TextField.cs b/Terminal.Gui/Views/TextField.cs index 7b0f88e33..18b3a9a95 100644 --- a/Terminal.Gui/Views/TextField.cs +++ b/Terminal.Gui/Views/TextField.cs @@ -42,7 +42,7 @@ namespace Terminal.Gui { /// /// Changing event, raised before the changes and can be canceled or changing the new text. /// - public event Action TextChanging; + public event EventHandler TextChanging; /// /// Changed event, raised when the text has changed. @@ -1249,7 +1249,7 @@ namespace Terminal.Gui { public virtual TextChangingEventArgs OnTextChanging (ustring newText) { var ev = new TextChangingEventArgs (newText); - TextChanging?.Invoke (ev); + TextChanging?.Invoke (this, ev); return ev; } diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index 8556b6cfb..cca45f7ea 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -1156,7 +1156,7 @@ namespace Terminal.Gui { /// set, not as the user types. To be notified as the user changes the contents of the TextView /// see . /// - public event Action TextChanged; + public event EventHandler TextChanged; /// /// Raised when the contents of the are changed. @@ -1165,7 +1165,7 @@ namespace Terminal.Gui { /// Unlike the event, this event is raised whenever the user types or /// otherwise changes the contents of the . /// - public event Action ContentsChanged; + public event EventHandler ContentsChanged; /// /// Invoked with the unwrapped . @@ -1492,7 +1492,7 @@ namespace Terminal.Gui { wrapManager = new WordWrapManager (model); model = wrapManager.WrapModel (frameWidth, out _, out _, out _, out _); } - TextChanged?.Invoke (); + TextChanged?.Invoke (this, EventArgs.Empty); SetNeedsDisplay (); historyText.Clear (Text); @@ -2742,7 +2742,7 @@ namespace Terminal.Gui { /// public virtual void OnContentsChanged () { - ContentsChanged?.Invoke (new ContentsChangedEventArgs (CurrentRow, CurrentColumn)); + ContentsChanged?.Invoke (this, new ContentsChangedEventArgs (CurrentRow, CurrentColumn)); } (int width, int height) OffSetBackground () diff --git a/Terminal.Gui/Views/TileView.cs b/Terminal.Gui/Views/TileView.cs index d5a431721..5c0a09c6c 100644 --- a/Terminal.Gui/Views/TileView.cs +++ b/Terminal.Gui/Views/TileView.cs @@ -101,7 +101,7 @@ namespace Terminal.Gui { public virtual bool OnTitleChanging (ustring oldTitle, ustring newTitle) { var args = new TitleEventArgs (oldTitle, newTitle); - TitleChanging?.Invoke (args); + TitleChanging?.Invoke (this, args); return args.Cancel; } @@ -109,7 +109,7 @@ namespace Terminal.Gui { /// Event fired when the is changing. Set to /// true to cancel the Title change. /// - public event Action TitleChanging; + public event EventHandler TitleChanging; /// /// Called when the has been changed. Invokes the event. @@ -119,13 +119,13 @@ namespace Terminal.Gui { public virtual void OnTitleChanged (ustring oldTitle, ustring newTitle) { var args = new TitleEventArgs (oldTitle, newTitle); - TitleChanged?.Invoke (args); + TitleChanged?.Invoke (this, args); } /// /// Event fired after the has been changed. /// - public event Action TitleChanged; + public event EventHandler TitleChanged; /// /// Creates a new instance of the class. @@ -233,7 +233,7 @@ namespace Terminal.Gui { var tile = new Tile (); tiles.Add (tile); Add (tile.ContentView); - tile.TitleChanged += (e) => SetNeedsDisplay (); + tile.TitleChanged += (s,e) => SetNeedsDisplay (); } LayoutSubviews (); diff --git a/Terminal.Gui/Views/TimeField.cs b/Terminal.Gui/Views/TimeField.cs index 1675a295a..132803dbc 100644 --- a/Terminal.Gui/Views/TimeField.cs +++ b/Terminal.Gui/Views/TimeField.cs @@ -38,7 +38,7 @@ namespace Terminal.Gui { /// /// The passed is a containing the old value, new value, and format string. /// - public event Action> TimeChanged; + public event EventHandler> TimeChanged; /// /// Initializes a new instance of using positioning. @@ -336,7 +336,7 @@ namespace Terminal.Gui { /// The event arguments public virtual void OnTimeChanged (DateTimeEventArgs args) { - TimeChanged?.Invoke (args); + TimeChanged?.Invoke (this,args); } } } \ No newline at end of file diff --git a/Terminal.Gui/Views/TreeView.cs b/Terminal.Gui/Views/TreeView.cs index 7b8942c39..0b619e893 100644 --- a/Terminal.Gui/Views/TreeView.cs +++ b/Terminal.Gui/Views/TreeView.cs @@ -112,7 +112,7 @@ namespace Terminal.Gui { /// This event is raised when an object is activated e.g. by double clicking or /// pressing . /// - public event Action> ObjectActivated; + public event EventHandler> ObjectActivated; /// /// Key which when pressed triggers . @@ -712,7 +712,7 @@ namespace Terminal.Gui { /// protected virtual void OnObjectActivated (ObjectActivatedEventArgs e) { - ObjectActivated?.Invoke (e); + ObjectActivated?.Invoke (this,e); } /// diff --git a/Terminal.Gui/Windows/Wizard.cs b/Terminal.Gui/Windows/Wizard.cs index 846cb440d..f3fff9c03 100644 --- a/Terminal.Gui/Windows/Wizard.cs +++ b/Terminal.Gui/Windows/Wizard.cs @@ -132,7 +132,7 @@ namespace Terminal.Gui { public virtual bool OnTitleChanging (ustring oldTitle, ustring newTitle) { var args = new TitleEventArgs (oldTitle, newTitle); - TitleChanging?.Invoke (args); + TitleChanging?.Invoke (this, args); return args.Cancel; } @@ -140,7 +140,7 @@ namespace Terminal.Gui { /// Event fired when the is changing. Set to /// true to cancel the Title change. /// - public event Action TitleChanging; + public event EventHandler TitleChanging; /// /// Called when the has been changed. Invokes the event. @@ -150,13 +150,13 @@ namespace Terminal.Gui { public virtual void OnTitleChanged (ustring oldTitle, ustring newTitle) { var args = new TitleEventArgs (oldTitle, newTitle); - TitleChanged?.Invoke (args); + TitleChanged?.Invoke (this, args); } /// /// Event fired after the has been changed. /// - public event Action TitleChanged; + public event EventHandler TitleChanged; // The contentView works like the ContentView in FrameView. private View contentView = new View () { Data = "WizardContentView" }; @@ -211,7 +211,7 @@ namespace Terminal.Gui { var scrollBar = new ScrollBarView (helpTextView, true); - scrollBar.ChangedPosition += () => { + scrollBar.ChangedPosition += (s,e) => { helpTextView.TopRow = scrollBar.Position; if (helpTextView.TopRow != scrollBar.Position) { scrollBar.Position = helpTextView.TopRow; @@ -219,7 +219,7 @@ namespace Terminal.Gui { helpTextView.SetNeedsDisplay (); }; - scrollBar.OtherScrollBarView.ChangedPosition += () => { + scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { helpTextView.LeftColumn = scrollBar.OtherScrollBarView.Position; if (helpTextView.LeftColumn != scrollBar.OtherScrollBarView.Position) { scrollBar.OtherScrollBarView.Position = helpTextView.LeftColumn; @@ -396,7 +396,7 @@ namespace Terminal.Gui { { if (!finishedPressed) { var args = new WizardButtonEventArgs (); - Cancelled?.Invoke (args); + Cancelled?.Invoke (this, args); } } @@ -404,7 +404,7 @@ namespace Terminal.Gui { { if (CurrentStep == GetLastStep ()) { var args = new WizardButtonEventArgs (); - Finished?.Invoke (args); + Finished?.Invoke (this, args); if (!args.Cancel) { finishedPressed = true; if (IsCurrentTop) { @@ -416,7 +416,7 @@ namespace Terminal.Gui { } } else { var args = new WizardButtonEventArgs (); - MovingNext?.Invoke (args); + MovingNext?.Invoke (this, args); if (!args.Cancel) { GoNext (); } @@ -437,7 +437,7 @@ namespace Terminal.Gui { switch (kb.Key) { case Key.Esc: var args = new WizardButtonEventArgs (); - Cancelled?.Invoke (args); + Cancelled?.Invoke (this, args); return false; } } @@ -489,7 +489,7 @@ namespace Terminal.Gui { private void BackBtn_Clicked (object sender, EventArgs e) { var args = new WizardButtonEventArgs (); - MovingBack?.Invoke (args); + MovingBack?.Invoke (this, args); if (!args.Cancel) { GoBack (); } @@ -591,7 +591,7 @@ namespace Terminal.Gui { SizeStep (newStep); newStep.EnabledChanged += (s,e)=> UpdateButtonsAndTitle(); - newStep.TitleChanged += (args) => UpdateButtonsAndTitle (); + newStep.TitleChanged += (s,e) => UpdateButtonsAndTitle (); steps.AddLast (newStep); this.Add (newStep); UpdateButtonsAndTitle (); @@ -637,7 +637,7 @@ namespace Terminal.Gui { /// Raised when the Back button in the is clicked. The Back button is always /// the first button in the array of Buttons passed to the constructor, if any. /// - public event Action MovingBack; + public event EventHandler MovingBack; /// /// Raised when the Next/Finish button in the is clicked (or the user presses Enter). @@ -645,7 +645,7 @@ namespace Terminal.Gui { /// if any. This event is only raised if the is the last Step in the Wizard flow /// (otherwise the event is raised). /// - public event Action MovingNext; + public event EventHandler MovingNext; /// /// Raised when the Next/Finish button in the is clicked. The Next/Finish button is always @@ -653,7 +653,7 @@ namespace Terminal.Gui { /// raised if the is the last Step in the Wizard flow /// (otherwise the event is raised). /// - public event Action Finished; + public event EventHandler Finished; /// /// Raised when the user has cancelled the by pressin the Esc key. @@ -661,7 +661,7 @@ namespace Terminal.Gui { /// closing, cancel the event by setting to /// true before returning from the event handler. /// - public event Action Cancelled; + public event EventHandler Cancelled; /// /// for events. @@ -699,12 +699,12 @@ namespace Terminal.Gui { /// This event is raised when the current ) is about to change. Use /// to abort the transition. /// - public event Action StepChanging; + public event EventHandler StepChanging; /// /// This event is raised after the has changed the . /// - public event Action StepChanged; + public event EventHandler StepChanged; /// /// Gets or sets the currently active . @@ -725,7 +725,7 @@ namespace Terminal.Gui { public virtual bool OnStepChanging (WizardStep oldStep, WizardStep newStep) { var args = new StepChangeEventArgs (oldStep, newStep); - StepChanging?.Invoke (args); + StepChanging?.Invoke (this, args); return args.Cancel; } @@ -738,7 +738,7 @@ namespace Terminal.Gui { public virtual bool OnStepChanged (WizardStep oldStep, WizardStep newStep) { var args = new StepChangeEventArgs (oldStep, newStep); - StepChanged?.Invoke (args); + StepChanged?.Invoke (this, args); return args.Cancel; } diff --git a/UICatalog/Scenarios/AllViewsTester.cs b/UICatalog/Scenarios/AllViewsTester.cs index 7ef9ff4d6..2c52dc7d5 100644 --- a/UICatalog/Scenarios/AllViewsTester.cs +++ b/UICatalog/Scenarios/AllViewsTester.cs @@ -124,7 +124,7 @@ namespace UICatalog.Scenarios { X = 0, Y = Pos.Bottom (label), }; - _xRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _xRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView); _xText = new TextField ($"{_xVal}") { X = Pos.Right (label) + 1, Y = 0, Width = 4 }; _xText.TextChanged += (args) => { try { @@ -155,7 +155,7 @@ namespace UICatalog.Scenarios { X = Pos.X (label), Y = Pos.Bottom (label), }; - _yRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _yRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView); _locationFrame.Add (_yRadioGroup); _sizeFrame = new FrameView ("Size (Dim)") { @@ -172,7 +172,7 @@ namespace UICatalog.Scenarios { X = 0, Y = Pos.Bottom (label), }; - _wRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _wRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView); _wText = new TextField ($"{_wVal}") { X = Pos.Right (label) + 1, Y = 0, Width = 4 }; _wText.TextChanged += (args) => { try { @@ -219,7 +219,7 @@ namespace UICatalog.Scenarios { X = Pos.X (label), Y = Pos.Bottom (label), }; - _hRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _hRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView); _sizeFrame.Add (_hRadioGroup); _settingsPane.Add (_sizeFrame); diff --git a/UICatalog/Scenarios/Borders.cs b/UICatalog/Scenarios/Borders.cs index f1ed391af..60b0bd571 100644 --- a/UICatalog/Scenarios/Borders.cs +++ b/UICatalog/Scenarios/Borders.cs @@ -99,7 +99,7 @@ namespace UICatalog.Scenarios { Y = 1, Width = 5 }; - paddingTopEdit.TextChanging += (e) => { + paddingTopEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.Padding = new Thickness (smartPanel.Child.Border.Padding.Left, int.Parse (e.NewText.ToString ()), smartPanel.Child.Border.Padding.Right, @@ -123,7 +123,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - paddingLeftEdit.TextChanging += (e) => { + paddingLeftEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.Padding = new Thickness (int.Parse (e.NewText.ToString ()), smartPanel.Child.Border.Padding.Top, smartPanel.Child.Border.Padding.Right, @@ -146,7 +146,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - paddingRightEdit.TextChanging += (e) => { + paddingRightEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.Padding = new Thickness (smartPanel.Child.Border.Padding.Left, smartPanel.Child.Border.Padding.Top, int.Parse (e.NewText.ToString ()), @@ -169,7 +169,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - paddingBottomEdit.TextChanging += (e) => { + paddingBottomEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.Padding = new Thickness (smartPanel.Child.Border.Padding.Left, smartPanel.Child.Border.Padding.Top, smartPanel.Child.Border.Padding.Right, @@ -218,7 +218,7 @@ namespace UICatalog.Scenarios { Y = 1, Width = 5 }; - borderTopEdit.TextChanging += (e) => { + borderTopEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.BorderThickness = new Thickness (smartPanel.Child.Border.BorderThickness.Left, int.Parse (e.NewText.ToString ()), smartPanel.Child.Border.BorderThickness.Right, @@ -242,7 +242,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - borderLeftEdit.TextChanging += (e) => { + borderLeftEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.BorderThickness = new Thickness (int.Parse (e.NewText.ToString ()), smartPanel.Child.Border.BorderThickness.Top, smartPanel.Child.Border.BorderThickness.Right, @@ -265,7 +265,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - borderRightEdit.TextChanging += (e) => { + borderRightEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.BorderThickness = new Thickness (smartPanel.Child.Border.BorderThickness.Left, smartPanel.Child.Border.BorderThickness.Top, int.Parse (e.NewText.ToString ()), @@ -288,7 +288,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - borderBottomEdit.TextChanging += (e) => { + borderBottomEdit.TextChanging += (s, e) => { try { smartPanel.Child.Border.BorderThickness = new Thickness (smartPanel.Child.Border.BorderThickness.Left, smartPanel.Child.Border.BorderThickness.Top, smartPanel.Child.Border.BorderThickness.Right, @@ -348,7 +348,7 @@ namespace UICatalog.Scenarios { }; Win.Add (cbDrawMarginFrame); - rbBorderStyle.SelectedItemChanged += (e) => { + rbBorderStyle.SelectedItemChanged += (s,e) => { smartPanel.Child.Border.BorderStyle = (BorderStyle)e.SelectedItem; smartLabel.Border.BorderStyle = (BorderStyle)e.SelectedItem; smartLabel.SetNeedsDisplay (); @@ -378,7 +378,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - effect3DOffsetX.TextChanging += (e) => { + effect3DOffsetX.TextChanging += (s, e) => { try { smartPanel.Child.Border.Effect3DOffset = new Point (int.Parse (e.NewText.ToString ()), smartPanel.Child.Border.Effect3DOffset.Y); @@ -404,7 +404,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - effect3DOffsetY.TextChanging += (e) => { + effect3DOffsetY.TextChanging += (s, e) => { try { smartPanel.Child.Border.Effect3DOffset = new Point (smartPanel.Child.Border.Effect3DOffset.X, int.Parse (e.NewText.ToString ())); @@ -439,7 +439,7 @@ namespace UICatalog.Scenarios { Y = 6, SelectedItem = (int)smartLabel.Border.Background }; - rbBackground.SelectedItemChanged += (e) => { + rbBackground.SelectedItemChanged += (s,e) => { smartPanel.Child.Border.Background = smartLabel.Border.Background = (Color)e.SelectedItem; }; Win.Add (rbBackground); @@ -456,7 +456,7 @@ namespace UICatalog.Scenarios { Y = 6, SelectedItem = (int)smartLabel.Border.BorderBrush }; - rbBorderBrush.SelectedItemChanged += (e) => { + rbBorderBrush.SelectedItemChanged += (s,e) => { smartPanel.Child.Border.BorderBrush = smartLabel.Border.BorderBrush = (Color)e.SelectedItem; }; Win.Add (rbBorderBrush); diff --git a/UICatalog/Scenarios/BordersOnContainers.cs b/UICatalog/Scenarios/BordersOnContainers.cs index 2b17284ae..f330d317e 100644 --- a/UICatalog/Scenarios/BordersOnContainers.cs +++ b/UICatalog/Scenarios/BordersOnContainers.cs @@ -64,7 +64,7 @@ namespace UICatalog.Scenarios { Y = 1, Width = 5 }; - paddingTopEdit.TextChanging += (e) => { + paddingTopEdit.TextChanging += (s,e) => { try { smartView.Border.Padding = new Thickness (smartView.Border.Padding.Left, int.Parse (e.NewText.ToString ()), smartView.Border.Padding.Right, @@ -84,7 +84,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - paddingLeftEdit.TextChanging += (e) => { + paddingLeftEdit.TextChanging += (s,e) => { try { smartView.Border.Padding = new Thickness (int.Parse (e.NewText.ToString ()), smartView.Border.Padding.Top, smartView.Border.Padding.Right, @@ -103,7 +103,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - paddingRightEdit.TextChanging += (e) => { + paddingRightEdit.TextChanging += (s,e) => { try { smartView.Border.Padding = new Thickness (smartView.Border.Padding.Left, smartView.Border.Padding.Top, int.Parse (e.NewText.ToString ()), @@ -122,7 +122,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - paddingBottomEdit.TextChanging += (e) => { + paddingBottomEdit.TextChanging += (s,e) => { try { smartView.Border.Padding = new Thickness (smartView.Border.Padding.Left, smartView.Border.Padding.Top, smartView.Border.Padding.Right, @@ -158,7 +158,7 @@ namespace UICatalog.Scenarios { Y = 1, Width = 5 }; - borderTopEdit.TextChanging += (e) => { + borderTopEdit.TextChanging += (s,e) => { try { smartView.Border.BorderThickness = new Thickness (smartView.Border.BorderThickness.Left, int.Parse (e.NewText.ToString ()), smartView.Border.BorderThickness.Right, @@ -178,7 +178,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - borderLeftEdit.TextChanging += (e) => { + borderLeftEdit.TextChanging += (s,e) => { try { smartView.Border.BorderThickness = new Thickness (int.Parse (e.NewText.ToString ()), smartView.Border.BorderThickness.Top, smartView.Border.BorderThickness.Right, @@ -197,7 +197,7 @@ namespace UICatalog.Scenarios { Y = 2, Width = 5 }; - borderRightEdit.TextChanging += (e) => { + borderRightEdit.TextChanging += (s,e) => { try { smartView.Border.BorderThickness = new Thickness (smartView.Border.BorderThickness.Left, smartView.Border.BorderThickness.Top, int.Parse (e.NewText.ToString ()), @@ -216,7 +216,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - borderBottomEdit.TextChanging += (e) => { + borderBottomEdit.TextChanging += (s,e) => { try { smartView.Border.BorderThickness = new Thickness (smartView.Border.BorderThickness.Left, smartView.Border.BorderThickness.Top, smartView.Border.BorderThickness.Right, @@ -272,7 +272,7 @@ namespace UICatalog.Scenarios { }; Add (cbDrawMarginFrame); - rbBorderStyle.SelectedItemChanged += (e) => { + rbBorderStyle.SelectedItemChanged += (s,e) => { smartView.Border.BorderStyle = (BorderStyle)e.SelectedItem; smartView.SetNeedsDisplay (); if (cbDrawMarginFrame.Checked != smartView.Border.DrawMarginFrame) { @@ -301,7 +301,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - effect3DOffsetX.TextChanging += (e) => { + effect3DOffsetX.TextChanging += (s,e) => { try { smartView.Border.Effect3DOffset = new Point (int.Parse (e.NewText.ToString ()), smartView.Border.Effect3DOffset.Y); @@ -324,7 +324,7 @@ namespace UICatalog.Scenarios { Y = 3, Width = 5 }; - effect3DOffsetY.TextChanging += (e) => { + effect3DOffsetY.TextChanging += (s,e) => { try { smartView.Border.Effect3DOffset = new Point (smartView.Border.Effect3DOffset.X, int.Parse (e.NewText.ToString ())); @@ -356,7 +356,7 @@ namespace UICatalog.Scenarios { Y = 6, SelectedItem = (int)smartView.Border.Background }; - rbBackground.SelectedItemChanged += (e) => { + rbBackground.SelectedItemChanged += (s,e) => { smartView.Border.Background = (Color)e.SelectedItem; }; Add (rbBackground); @@ -373,7 +373,7 @@ namespace UICatalog.Scenarios { Y = 6, SelectedItem = (int)smartView.Border.BorderBrush }; - rbBorderBrush.SelectedItemChanged += (e) => { + rbBorderBrush.SelectedItemChanged += (s,e) => { smartView.Border.BorderBrush = (Color)e.SelectedItem; }; Add (rbBorderBrush); diff --git a/UICatalog/Scenarios/Buttons.cs b/UICatalog/Scenarios/Buttons.cs index 678914170..313f15477 100644 --- a/UICatalog/Scenarios/Buttons.cs +++ b/UICatalog/Scenarios/Buttons.cs @@ -235,7 +235,7 @@ namespace UICatalog.Scenarios { }; Win.Add (moveUnicodeHotKeyBtn); - radioGroup.SelectedItemChanged += (args) => { + radioGroup.SelectedItemChanged += (s, args) => { switch (args.SelectedItem) { case 0: moveBtn.TextAlignment = TextAlignment.Left; diff --git a/UICatalog/Scenarios/ConfigurationEditor.cs b/UICatalog/Scenarios/ConfigurationEditor.cs index 6b29ebd94..258cccf13 100644 --- a/UICatalog/Scenarios/ConfigurationEditor.cs +++ b/UICatalog/Scenarios/ConfigurationEditor.cs @@ -82,7 +82,7 @@ namespace UICatalog.Scenarios { internal ConfigTextView () { - ContentsChanged += (obj) => { + ContentsChanged += (s,obj) => { if (IsDirty) { if (!Tile.Title.EndsWith ('*')) { Tile.Title += '*'; diff --git a/UICatalog/Scenarios/CsvEditor.cs b/UICatalog/Scenarios/CsvEditor.cs index 89062a7e6..0ae0ccb63 100644 --- a/UICatalog/Scenarios/CsvEditor.cs +++ b/UICatalog/Scenarios/CsvEditor.cs @@ -114,7 +114,7 @@ namespace UICatalog.Scenarios { } } - private void OnSelectedCellChanged (TableView.SelectedCellChangedEventArgs e) + private void OnSelectedCellChanged (object sender, TableView.SelectedCellChangedEventArgs e) { // only update the text box if the user is not manually editing it if (!selectedCellLabel.HasFocus) @@ -446,7 +446,7 @@ namespace UICatalog.Scenarios { { var _scrollBar = new ScrollBarView (tableView, true); - _scrollBar.ChangedPosition += () => { + _scrollBar.ChangedPosition += (s,e) => { tableView.RowOffset = _scrollBar.Position; if (tableView.RowOffset != _scrollBar.Position) { _scrollBar.Position = tableView.RowOffset; @@ -454,7 +454,7 @@ namespace UICatalog.Scenarios { tableView.SetNeedsDisplay (); }; /* - _scrollBar.OtherScrollBarView.ChangedPosition += () => { + _scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { _listView.LeftItem = _scrollBar.OtherScrollBarView.Position; if (_listView.LeftItem != _scrollBar.OtherScrollBarView.Position) { _scrollBar.OtherScrollBarView.Position = _listView.LeftItem; @@ -540,7 +540,7 @@ namespace UICatalog.Scenarios { enteredText = okPressed ? tf.Text.ToString () : null; return okPressed; } - private void EditCurrentCell (TableView.CellActivatedEventArgs e) + private void EditCurrentCell (object sender, TableView.CellActivatedEventArgs e) { if (e.Table == null) return; diff --git a/UICatalog/Scenarios/Editor.cs b/UICatalog/Scenarios/Editor.cs index a39b420cc..1a98fea9f 100644 --- a/UICatalog/Scenarios/Editor.cs +++ b/UICatalog/Scenarios/Editor.cs @@ -128,7 +128,7 @@ namespace UICatalog.Scenarios { _scrollBar = new ScrollBarView (_textView, true); - _scrollBar.ChangedPosition += () => { + _scrollBar.ChangedPosition += (s,e) => { _textView.TopRow = _scrollBar.Position; if (_textView.TopRow != _scrollBar.Position) { _scrollBar.Position = _textView.TopRow; @@ -136,7 +136,7 @@ namespace UICatalog.Scenarios { _textView.SetNeedsDisplay (); }; - _scrollBar.OtherScrollBarView.ChangedPosition += () => { + _scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { _textView.LeftColumn = _scrollBar.OtherScrollBarView.Position; if (_textView.LeftColumn != _scrollBar.OtherScrollBarView.Position) { _scrollBar.OtherScrollBarView.Position = _textView.LeftColumn; diff --git a/UICatalog/Scenarios/LabelsAsButtons.cs b/UICatalog/Scenarios/LabelsAsButtons.cs index 0c58c82a3..bfdaf8152 100644 --- a/UICatalog/Scenarios/LabelsAsButtons.cs +++ b/UICatalog/Scenarios/LabelsAsButtons.cs @@ -269,7 +269,7 @@ namespace UICatalog.Scenarios { }; Win.Add (moveUnicodeHotKeyBtn); - radioGroup.SelectedItemChanged += (args) => { + radioGroup.SelectedItemChanged += (s,args) => { switch (args.SelectedItem) { case 0: moveBtn.TextAlignment = TextAlignment.Left; diff --git a/UICatalog/Scenarios/ListViewWithSelection.cs b/UICatalog/Scenarios/ListViewWithSelection.cs index c1d333290..b05dfea27 100644 --- a/UICatalog/Scenarios/ListViewWithSelection.cs +++ b/UICatalog/Scenarios/ListViewWithSelection.cs @@ -62,7 +62,7 @@ namespace UICatalog.Scenarios { var _scrollBar = new ScrollBarView (_listView, true); - _scrollBar.ChangedPosition += () => { + _scrollBar.ChangedPosition += (s,e) => { _listView.TopItem = _scrollBar.Position; if (_listView.TopItem != _scrollBar.Position) { _scrollBar.Position = _listView.TopItem; @@ -70,7 +70,7 @@ namespace UICatalog.Scenarios { _listView.SetNeedsDisplay (); }; - _scrollBar.OtherScrollBarView.ChangedPosition += () => { + _scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { _listView.LeftItem = _scrollBar.OtherScrollBarView.Position; if (_listView.LeftItem != _scrollBar.OtherScrollBarView.Position) { _scrollBar.OtherScrollBarView.Position = _listView.LeftItem; diff --git a/UICatalog/Scenarios/ListsAndCombos.cs b/UICatalog/Scenarios/ListsAndCombos.cs index bd1881955..80ebac623 100644 --- a/UICatalog/Scenarios/ListsAndCombos.cs +++ b/UICatalog/Scenarios/ListsAndCombos.cs @@ -41,7 +41,7 @@ namespace UICatalog.Scenarios { var _scrollBar = new ScrollBarView (listview, true); - _scrollBar.ChangedPosition += () => { + _scrollBar.ChangedPosition += (s,e) => { listview.TopItem = _scrollBar.Position; if (listview.TopItem != _scrollBar.Position) { _scrollBar.Position = listview.TopItem; @@ -49,7 +49,7 @@ namespace UICatalog.Scenarios { listview.SetNeedsDisplay (); }; - _scrollBar.OtherScrollBarView.ChangedPosition += () => { + _scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { listview.LeftItem = _scrollBar.OtherScrollBarView.Position; if (listview.LeftItem != _scrollBar.OtherScrollBarView.Position) { _scrollBar.OtherScrollBarView.Position = listview.LeftItem; @@ -85,7 +85,7 @@ namespace UICatalog.Scenarios { var scrollBarCbx = new ScrollBarView (comboBox.Subviews [1], true); - scrollBarCbx.ChangedPosition += () => { + scrollBarCbx.ChangedPosition += (s,e) => { ((ListView)comboBox.Subviews [1]).TopItem = scrollBarCbx.Position; if (((ListView)comboBox.Subviews [1]).TopItem != scrollBarCbx.Position) { scrollBarCbx.Position = ((ListView)comboBox.Subviews [1]).TopItem; @@ -93,7 +93,7 @@ namespace UICatalog.Scenarios { comboBox.SetNeedsDisplay (); }; - scrollBarCbx.OtherScrollBarView.ChangedPosition += () => { + scrollBarCbx.OtherScrollBarView.ChangedPosition += (s,e) => { ((ListView)comboBox.Subviews [1]).LeftItem = scrollBarCbx.OtherScrollBarView.Position; if (((ListView)comboBox.Subviews [1]).LeftItem != scrollBarCbx.OtherScrollBarView.Position) { scrollBarCbx.OtherScrollBarView.Position = ((ListView)comboBox.Subviews [1]).LeftItem; diff --git a/UICatalog/Scenarios/MultiColouredTable.cs b/UICatalog/Scenarios/MultiColouredTable.cs index 6bce14ff6..75b67a0f6 100644 --- a/UICatalog/Scenarios/MultiColouredTable.cs +++ b/UICatalog/Scenarios/MultiColouredTable.cs @@ -98,7 +98,7 @@ namespace UICatalog.Scenarios { enteredText = okPressed ? tf.Text.ToString () : null; return okPressed; } - private void EditCurrentCell (TableView.CellActivatedEventArgs e) + private void EditCurrentCell (object sender, TableView.CellActivatedEventArgs e) { if (e.Table == null) return; diff --git a/UICatalog/Scenarios/ProgressBarStyles.cs b/UICatalog/Scenarios/ProgressBarStyles.cs index bad40aae7..bc8ba33e0 100644 --- a/UICatalog/Scenarios/ProgressBarStyles.cs +++ b/UICatalog/Scenarios/ProgressBarStyles.cs @@ -113,7 +113,7 @@ namespace UICatalog.Scenarios { }; Win.Add (marqueesContinuousPB); - rbPBFormat.SelectedItemChanged += (e) => { + rbPBFormat.SelectedItemChanged += (s,e) => { blocksPB.ProgressBarFormat = (ProgressBarFormat)e.SelectedItem; continuousPB.ProgressBarFormat = (ProgressBarFormat)e.SelectedItem; marqueesBlocksPB.ProgressBarFormat = (ProgressBarFormat)e.SelectedItem; diff --git a/UICatalog/Scenarios/TableEditor.cs b/UICatalog/Scenarios/TableEditor.cs index a11fddd25..e5bcb40f4 100644 --- a/UICatalog/Scenarios/TableEditor.cs +++ b/UICatalog/Scenarios/TableEditor.cs @@ -103,7 +103,7 @@ namespace UICatalog.Scenarios { Win.Add (selectedCellLabel); - tableView.SelectedCellChanged += (e) => { selectedCellLabel.Text = $"{tableView.SelectedRow},{tableView.SelectedColumn}"; }; + tableView.SelectedCellChanged += (s, e) => { selectedCellLabel.Text = $"{tableView.SelectedRow},{tableView.SelectedColumn}"; }; tableView.CellActivated += EditCurrentCell; tableView.KeyPress += TableViewKeyPress; @@ -319,7 +319,7 @@ namespace UICatalog.Scenarios { { var _scrollBar = new ScrollBarView (tableView, true); - _scrollBar.ChangedPosition += () => { + _scrollBar.ChangedPosition += (s,e) => { tableView.RowOffset = _scrollBar.Position; if (tableView.RowOffset != _scrollBar.Position) { _scrollBar.Position = tableView.RowOffset; @@ -327,7 +327,7 @@ namespace UICatalog.Scenarios { tableView.SetNeedsDisplay (); }; /* - _scrollBar.OtherScrollBarView.ChangedPosition += () => { + _scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { _listView.LeftItem = _scrollBar.OtherScrollBarView.Position; if (_listView.LeftItem != _scrollBar.OtherScrollBarView.Position) { _scrollBar.OtherScrollBarView.Position = _listView.LeftItem; @@ -748,7 +748,7 @@ namespace UICatalog.Scenarios { tableView.Table = BuildSimpleDataTable (big ? 30 : 5, big ? 1000 : 5); } - private void EditCurrentCell (TableView.CellActivatedEventArgs e) + private void EditCurrentCell (object sender, TableView.CellActivatedEventArgs e) { if (e.Table == null) return; diff --git a/UICatalog/Scenarios/Text.cs b/UICatalog/Scenarios/Text.cs index 00ddf3af0..7521e6c3d 100644 --- a/UICatalog/Scenarios/Text.cs +++ b/UICatalog/Scenarios/Text.cs @@ -26,7 +26,7 @@ namespace UICatalog.Scenarios { }; textField.TextChanging += TextField_TextChanging; - void TextField_TextChanging (TextChangingEventArgs e) + void TextField_TextChanging (object sender, TextChangingEventArgs e) { textField.Autocomplete.AllSuggestions = Regex.Matches (e.NewText.ToString (), "\\w+") .Select (s => s.Value) @@ -75,7 +75,7 @@ namespace UICatalog.Scenarios { // Use ContentChanged to detect if the user has typed something in a TextView. // The TextChanged property is only fired if the TextView.Text property is // explicitly set - textView.ContentsChanged += (a) => { + textView.ContentsChanged += (s,a) => { labelMirroringTextView.Enabled = !labelMirroringTextView.Enabled; labelMirroringTextView.Text = textView.Text; }; @@ -218,7 +218,7 @@ namespace UICatalog.Scenarios { TimeField _timeField; Label _labelMirroringTimeField; - private void TimeChanged (DateTimeEventArgs e) + private void TimeChanged (object sender, DateTimeEventArgs e) { _labelMirroringTimeField.Text = _timeField.Text; } diff --git a/UICatalog/Scenarios/TextAlignments.cs b/UICatalog/Scenarios/TextAlignments.cs index defc68eb4..8d10bdacc 100644 --- a/UICatalog/Scenarios/TextAlignments.cs +++ b/UICatalog/Scenarios/TextAlignments.cs @@ -40,7 +40,7 @@ namespace UICatalog.Scenarios { ColorScheme = Colors.TopLevel, Text = txt, }; - edit.TextChanged += () => { + edit.TextChanged += (s,e) => { foreach (var alignment in alignments) { singleLines [(int)alignment].Text = edit.Text; multipleLines [(int)alignment].Text = edit.Text; diff --git a/UICatalog/Scenarios/TextAlignmentsAndDirection.cs b/UICatalog/Scenarios/TextAlignmentsAndDirection.cs index a78a4e9b8..9d8886b58 100644 --- a/UICatalog/Scenarios/TextAlignmentsAndDirection.cs +++ b/UICatalog/Scenarios/TextAlignmentsAndDirection.cs @@ -175,7 +175,7 @@ namespace UICatalog.Scenarios { HotKeySpecifier = '\xffff' }; - directionOptions.SelectedItemChanged += (ev) => { + directionOptions.SelectedItemChanged += (s, ev) => { foreach (var v in mtxts) { v.TextDirection = (TextDirection)ev.SelectedItem; } diff --git a/UICatalog/Scenarios/TimeAndDate.cs b/UICatalog/Scenarios/TimeAndDate.cs index 7885c3dd2..87983eddb 100644 --- a/UICatalog/Scenarios/TimeAndDate.cs +++ b/UICatalog/Scenarios/TimeAndDate.cs @@ -118,14 +118,14 @@ namespace UICatalog.Scenarios { Win.Add (swapButton); } - private void TimeChanged (DateTimeEventArgs e) + private void TimeChanged (object sender, DateTimeEventArgs e) { lblOldTime.Text = $"Old Time: {e.OldValue}"; lblNewTime.Text = $"New Time: {e.NewValue}"; lblTimeFmt.Text = $"Time Format: {e.Format}"; } - private void DateChanged (DateTimeEventArgs e) + private void DateChanged (object sender, DateTimeEventArgs e) { lblOldDate.Text = $"Old Date: {e.OldValue}"; lblNewDate.Text = $"New Date: {e.NewValue}"; diff --git a/UICatalog/Scenarios/TreeViewFileSystem.cs b/UICatalog/Scenarios/TreeViewFileSystem.cs index 56fcc7d4d..d015e33e0 100644 --- a/UICatalog/Scenarios/TreeViewFileSystem.cs +++ b/UICatalog/Scenarios/TreeViewFileSystem.cs @@ -204,7 +204,7 @@ namespace UICatalog.Scenarios { var _scrollBar = new ScrollBarView (treeViewFiles, true); - _scrollBar.ChangedPosition += () => { + _scrollBar.ChangedPosition += (s,e) => { treeViewFiles.ScrollOffsetVertical = _scrollBar.Position; if (treeViewFiles.ScrollOffsetVertical != _scrollBar.Position) { _scrollBar.Position = treeViewFiles.ScrollOffsetVertical; @@ -212,7 +212,7 @@ namespace UICatalog.Scenarios { treeViewFiles.SetNeedsDisplay (); }; - _scrollBar.OtherScrollBarView.ChangedPosition += () => { + _scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { treeViewFiles.ScrollOffsetHorizontal = _scrollBar.OtherScrollBarView.Position; if (treeViewFiles.ScrollOffsetHorizontal != _scrollBar.OtherScrollBarView.Position) { _scrollBar.OtherScrollBarView.Position = treeViewFiles.ScrollOffsetHorizontal; diff --git a/UICatalog/Scenarios/WizardAsView.cs b/UICatalog/Scenarios/WizardAsView.cs index e4ed7f4e5..9727b8d51 100644 --- a/UICatalog/Scenarios/WizardAsView.cs +++ b/UICatalog/Scenarios/WizardAsView.cs @@ -35,23 +35,23 @@ namespace UICatalog.Scenarios { // behave like an non-modal View (vs. a modal/pop-up Window). wizard.Modal = false; - wizard.MovingBack += (args) => { + wizard.MovingBack += (s,args) => { //args.Cancel = true; //actionLabel.Text = "Moving Back"; }; - wizard.MovingNext += (args) => { + wizard.MovingNext += (s,args) => { //args.Cancel = true; //actionLabel.Text = "Moving Next"; }; - wizard.Finished += (args) => { + wizard.Finished += (s,args) => { //args.Cancel = true; MessageBox.Query ("Setup Wizard", "Finished", "Ok"); Application.RequestStop (); }; - wizard.Cancelled += (args) => { + wizard.Cancelled += (s,args) => { var btn = MessageBox.Query ("Setup Wizard", "Are you sure you want to cancel?", "Yes", "No"); args.Cancel = btn == 1; if (btn == 0) { diff --git a/UICatalog/Scenarios/Wizards.cs b/UICatalog/Scenarios/Wizards.cs index b358aada0..a6a94e3fa 100644 --- a/UICatalog/Scenarios/Wizards.cs +++ b/UICatalog/Scenarios/Wizards.cs @@ -116,22 +116,22 @@ namespace UICatalog.Scenarios { Height = height }; - wizard.MovingBack += (args) => { + wizard.MovingBack += (s, args) => { //args.Cancel = true; actionLabel.Text = "Moving Back"; }; - wizard.MovingNext += (args) => { + wizard.MovingNext += (s, args) => { //args.Cancel = true; actionLabel.Text = "Moving Next"; }; - wizard.Finished += (args) => { + wizard.Finished += (s, args) => { //args.Cancel = true; actionLabel.Text = "Finished"; }; - wizard.Cancelled += (args) => { + wizard.Cancelled += (s, args) => { //args.Cancel = true; actionLabel.Text = "Cancelled"; }; @@ -176,7 +176,7 @@ namespace UICatalog.Scenarios { }; frame.Add (new TextField ("This is a TextField inside of the frame.")); secondStep.Add (frame); - wizard.StepChanging += (args) => { + wizard.StepChanging += (s, args) => { if (args.OldStep == secondStep && firstNameField.Text.IsEmpty) { args.Cancel = true; var btn = MessageBox.ErrorQuery ("Second Step", "You must enter a First Name to continue", "Ok"); @@ -237,7 +237,7 @@ namespace UICatalog.Scenarios { fourthStep.NextButtonText = "Go To Last Step"; var scrollBar = new ScrollBarView (someText, true); - scrollBar.ChangedPosition += () => { + scrollBar.ChangedPosition += (s,e) => { someText.TopRow = scrollBar.Position; if (someText.TopRow != scrollBar.Position) { scrollBar.Position = someText.TopRow; diff --git a/UnitTests/TopLevels/WizardTests.cs b/UnitTests/TopLevels/WizardTests.cs index 1502e2eb8..ea6d8f6b0 100644 --- a/UnitTests/TopLevels/WizardTests.cs +++ b/UnitTests/TopLevels/WizardTests.cs @@ -518,7 +518,7 @@ namespace Terminal.Gui.TopLevelTests { wizard.AddStep (step1); var finishedFired = false; - wizard.Finished += (args) => { + wizard.Finished += (s, args) => { finishedFired = true; }; @@ -548,7 +548,7 @@ namespace Terminal.Gui.TopLevelTests { wizard.AddStep (step2); finishedFired = false; - wizard.Finished += (args) => { + wizard.Finished += (s, args) => { finishedFired = true; }; @@ -586,7 +586,7 @@ namespace Terminal.Gui.TopLevelTests { step1.Enabled = false; finishedFired = false; - wizard.Finished += (args) => { + wizard.Finished += (s, args) => { finishedFired = true; }; diff --git a/UnitTests/UICatalog/ScenarioTests.cs b/UnitTests/UICatalog/ScenarioTests.cs index a1ea6e14e..1104154b3 100644 --- a/UnitTests/UICatalog/ScenarioTests.cs +++ b/UnitTests/UICatalog/ScenarioTests.cs @@ -310,7 +310,7 @@ namespace UICatalog.Tests { } }; - _xRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _xRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView); _xText.TextChanged += (args) => { try { @@ -330,9 +330,9 @@ namespace UICatalog.Tests { } }; - _yRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _yRadioGroup.SelectedItemChanged += (s,selected) => DimPosChanged (_curView); - _wRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _wRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView); _wText.TextChanged += (args) => { try { @@ -352,7 +352,7 @@ namespace UICatalog.Tests { } }; - _hRadioGroup.SelectedItemChanged += (selected) => DimPosChanged (_curView); + _hRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView); Top.Add (_leftPane, _settingsPane, _hostPane); diff --git a/UnitTests/Views/RadioGroupTests.cs b/UnitTests/Views/RadioGroupTests.cs index ec2e76a18..2c1e8a93c 100644 --- a/UnitTests/Views/RadioGroupTests.cs +++ b/UnitTests/Views/RadioGroupTests.cs @@ -150,7 +150,7 @@ namespace Terminal.Gui.ViewTests { var previousSelectedItem = -1; var selectedItem = -1; var rg = new RadioGroup (new NStack.ustring [] { "Test", "New Test" }); - rg.SelectedItemChanged += (e) => { + rg.SelectedItemChanged += (s,e) => { previousSelectedItem = e.PreviousSelectedItem; selectedItem = e.SelectedItem; }; diff --git a/UnitTests/Views/ScrollBarViewTests.cs b/UnitTests/Views/ScrollBarViewTests.cs index e421b7971..30f1a134c 100644 --- a/UnitTests/Views/ScrollBarViewTests.cs +++ b/UnitTests/Views/ScrollBarViewTests.cs @@ -85,7 +85,7 @@ namespace Terminal.Gui.ViewTests { _scrollBar.Refresh (); } - private void _scrollBar_ChangedPosition () + private void _scrollBar_ChangedPosition (object sender, EventArgs e) { _hostView.Top = _scrollBar.Position; if (_hostView.Top != _scrollBar.Position) { @@ -94,7 +94,7 @@ namespace Terminal.Gui.ViewTests { _hostView.SetNeedsDisplay (); } - private void _scrollBar_OtherScrollBarView_ChangedPosition () + private void _scrollBar_OtherScrollBarView_ChangedPosition (object sender, EventArgs e) { _hostView.Left = _scrollBar.OtherScrollBarView.Position; if (_hostView.Left != _scrollBar.OtherScrollBarView.Position) { @@ -478,7 +478,7 @@ namespace Terminal.Gui.ViewTests { }; win.Add (newScrollBarView); - newScrollBarView.ChangedPosition += () => { + newScrollBarView.ChangedPosition += (s,e) => { listView.TopItem = newScrollBarView.Position; if (listView.TopItem != newScrollBarView.Position) { newScrollBarView.Position = listView.TopItem; @@ -553,7 +553,7 @@ namespace Terminal.Gui.ViewTests { }; win.Add (newScrollBarView); - newScrollBarView.ChangedPosition += () => { + newScrollBarView.ChangedPosition += (s,e) => { listView.LeftItem = newScrollBarView.Position; if (listView.LeftItem != newScrollBarView.Position) { newScrollBarView.Position = listView.LeftItem; @@ -652,7 +652,7 @@ namespace Terminal.Gui.ViewTests { var scrollBar = new ScrollBarView (textView, true); - scrollBar.ChangedPosition += () => { + scrollBar.ChangedPosition += (s,e) => { textView.TopRow = scrollBar.Position; if (textView.TopRow != scrollBar.Position) { scrollBar.Position = textView.TopRow; @@ -660,7 +660,7 @@ namespace Terminal.Gui.ViewTests { textView.SetNeedsDisplay (); }; - scrollBar.OtherScrollBarView.ChangedPosition += () => { + scrollBar.OtherScrollBarView.ChangedPosition += (s,e) => { textView.LeftColumn = scrollBar.OtherScrollBarView.Position; if (textView.LeftColumn != scrollBar.OtherScrollBarView.Position) { scrollBar.OtherScrollBarView.Position = textView.LeftColumn; diff --git a/UnitTests/Views/TableViewTests.cs b/UnitTests/Views/TableViewTests.cs index e4c46aa7b..b79e10f11 100644 --- a/UnitTests/Views/TableViewTests.cs +++ b/UnitTests/Views/TableViewTests.cs @@ -100,7 +100,7 @@ namespace Terminal.Gui.ViewTests { }; bool called = false; - tableView.SelectedCellChanged += (e) => { called = true; }; + tableView.SelectedCellChanged += (s,e) => { called = true; }; Assert.Equal (0, tableView.SelectedColumn); Assert.False (called); @@ -124,7 +124,7 @@ namespace Terminal.Gui.ViewTests { }; bool called = false; - tableView.SelectedCellChanged += (e) => { + tableView.SelectedCellChanged += (s,e) => { called = true; Assert.Equal (0, e.OldCol); Assert.Equal (10, e.NewCol); @@ -142,7 +142,7 @@ namespace Terminal.Gui.ViewTests { }; bool called = false; - tableView.SelectedCellChanged += (e) => { + tableView.SelectedCellChanged += (s,e) => { called = true; Assert.Equal (0, e.OldRow); Assert.Equal (10, e.NewRow); @@ -520,7 +520,7 @@ namespace Terminal.Gui.ViewTests { { string activatedValue = null; var tv = new TableView (BuildTable(1,1)); - tv.CellActivated += (c) => activatedValue = c.Table.Rows[c.Row][c.Col].ToString(); + tv.CellActivated += (s,c) => activatedValue = c.Table.Rows[c.Row][c.Col].ToString(); Application.Top.Add (tv); Application.Begin (Application.Top); diff --git a/UnitTests/Views/TextFieldTests.cs b/UnitTests/Views/TextFieldTests.cs index 531b35120..4eaa588ca 100644 --- a/UnitTests/Views/TextFieldTests.cs +++ b/UnitTests/Views/TextFieldTests.cs @@ -663,7 +663,7 @@ namespace Terminal.Gui.ViewTests { { bool cancel = true; - _textField.TextChanging += (e) => { + _textField.TextChanging += (s,e) => { Assert.Equal ("changing", e.NewText); if (cancel) { e.Cancel = true; @@ -781,7 +781,7 @@ namespace Terminal.Gui.ViewTests { Assert.Equal ("A", tf.Text.ToString ()); // cancel the next keystroke - tf.TextChanging += (e) => e.Cancel = e.NewText == "AB"; + tf.TextChanging += (s,e) => e.Cancel = e.NewText == "AB"; tf.ProcessKey (new KeyEvent (Key.B, new KeyModifiers ())); // B was canceled so should just be A @@ -1137,7 +1137,7 @@ namespace Terminal.Gui.ViewTests { var oldText = ""; var tf = new TextField () { Width = 10, Text = "-1" }; - tf.TextChanging += (e) => newText = e.NewText.ToString (); + tf.TextChanging += (s,e) => newText = e.NewText.ToString (); tf.TextChanged += (e) => oldText = e.ToString (); Application.Top.Add (tf); diff --git a/UnitTests/Views/TextViewTests.cs b/UnitTests/Views/TextViewTests.cs index 981ff2d14..372843a49 100644 --- a/UnitTests/Views/TextViewTests.cs +++ b/UnitTests/Views/TextViewTests.cs @@ -1380,7 +1380,7 @@ namespace Terminal.Gui.ViewTests { [TextViewTestsAutoInitShutdown] public void TextChanged_Event () { - _textView.TextChanged += () => { + _textView.TextChanged += (s,e) => { if (_textView.Text == "changing") { Assert.Equal ("changing", _textView.Text); _textView.Text = "changed"; @@ -1396,7 +1396,7 @@ namespace Terminal.Gui.ViewTests { public void TextChanged_Event_NoFires_OnTyping () { var eventcount = 0; - _textView.TextChanged += () => { + _textView.TextChanged += (s,e) => { eventcount++; }; @@ -6477,7 +6477,7 @@ This is the second line. Height = 10, }; - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; }; Assert.Equal (0, eventcount); @@ -6498,7 +6498,7 @@ This is the second line. }; tv.CursorPosition = new Point (0, 0); - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; }; @@ -6536,7 +6536,7 @@ This is the second line. Width = 50, Height = 10, }; - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; Assert.Equal (expectedRow, e.Row); Assert.Equal (expectedCol, e.Col); @@ -6565,7 +6565,7 @@ This is the second line. // row/col = 0 when you set Text Text = "abc", }; - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; Assert.Equal (expectedRow, e.Row); Assert.Equal (expectedCol, e.Col); @@ -6597,7 +6597,7 @@ This is the second line. Width = 50, Height = 10, }; - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; Assert.Equal (expectedRow, e.Row); Assert.Equal (expectedCol, e.Col); @@ -6622,7 +6622,7 @@ This is the second line. { var eventcount = 0; - _textView.ContentsChanged += (e) => { + _textView.ContentsChanged += (s,e) => { eventcount++; }; @@ -6649,7 +6649,7 @@ This is the second line. { var eventcount = 0; - _textView.ContentsChanged += (e) => { + _textView.ContentsChanged += (s,e) => { eventcount++; }; @@ -6715,7 +6715,7 @@ This is the second line. var eventcount = 0; var expectedEventCount = 0; - _textView.ContentsChanged += (e) => { + _textView.ContentsChanged += (s,e) => { eventcount++; }; @@ -6759,7 +6759,7 @@ This is the second line. Height = 10, Text = text, }; - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; }; @@ -6784,7 +6784,7 @@ This is the second line. Width = 50, Height = 10, }; - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; }; @@ -6804,7 +6804,7 @@ This is the second line. Width = 50, Height = 10, }; - tv.ContentsChanged += (e) => { + tv.ContentsChanged += (s,e) => { eventcount++; }; diff --git a/UnitTests/Views/TreeViewTests.cs b/UnitTests/Views/TreeViewTests.cs index 339033923..0fc4ca843 100644 --- a/UnitTests/Views/TreeViewTests.cs +++ b/UnitTests/Views/TreeViewTests.cs @@ -492,8 +492,8 @@ namespace Terminal.Gui.ViewTests { bool called = false; // register for the event - tree.ObjectActivated += (s) => { - activated = s.ActivatedObject; + tree.ObjectActivated += (s,e) => { + activated = e.ActivatedObject; called = true; }; @@ -565,8 +565,8 @@ namespace Terminal.Gui.ViewTests { bool called = false; // register for the event - tree.ObjectActivated += (s) => { - activated = s.ActivatedObject; + tree.ObjectActivated += (s,e) => { + activated = e.ActivatedObject; called = true; }; @@ -607,8 +607,8 @@ namespace Terminal.Gui.ViewTests { bool called = false; // register for the event - tree.ObjectActivated += (s) => { - activated = s.ActivatedObject; + tree.ObjectActivated += (s, e) => { + activated = e.ActivatedObject; called = true; }; @@ -638,8 +638,8 @@ namespace Terminal.Gui.ViewTests { bool called = false; // register for the event - tree.ObjectActivated += (s) => { - activated = s.ActivatedObject; + tree.ObjectActivated += (s,e) => { + activated = e.ActivatedObject; called = true; }; @@ -670,8 +670,8 @@ namespace Terminal.Gui.ViewTests { bool called = false; // register for the event - tree.ObjectActivated += (s) => { - activated = s.ActivatedObject; + tree.ObjectActivated += (s,e) => { + activated = e.ActivatedObject; called = true; };