浏览代码

Refactor more `event Action` to `event EventHandler`

tznind 2 年之前
父节点
当前提交
09683a2cd5
共有 38 个文件被更改,包括 159 次插入159 次删除
  1. 2 2
      Terminal.Gui/Views/DateField.cs
  2. 2 2
      Terminal.Gui/Views/RadioGroup.cs
  3. 2 2
      Terminal.Gui/Views/ScrollBarView.cs
  4. 4 4
      Terminal.Gui/Views/TableView.cs
  5. 2 2
      Terminal.Gui/Views/TextField.cs
  6. 4 4
      Terminal.Gui/Views/TextView.cs
  7. 5 5
      Terminal.Gui/Views/TileView.cs
  8. 2 2
      Terminal.Gui/Views/TimeField.cs
  9. 2 2
      Terminal.Gui/Views/TreeView.cs
  10. 20 20
      Terminal.Gui/Windows/Wizard.cs
  11. 4 4
      UICatalog/Scenarios/AllViewsTester.cs
  12. 13 13
      UICatalog/Scenarios/Borders.cs
  13. 13 13
      UICatalog/Scenarios/BordersOnContainers.cs
  14. 1 1
      UICatalog/Scenarios/Buttons.cs
  15. 1 1
      UICatalog/Scenarios/ConfigurationEditor.cs
  16. 4 4
      UICatalog/Scenarios/CsvEditor.cs
  17. 2 2
      UICatalog/Scenarios/Editor.cs
  18. 1 1
      UICatalog/Scenarios/LabelsAsButtons.cs
  19. 2 2
      UICatalog/Scenarios/ListViewWithSelection.cs
  20. 4 4
      UICatalog/Scenarios/ListsAndCombos.cs
  21. 1 1
      UICatalog/Scenarios/MultiColouredTable.cs
  22. 1 1
      UICatalog/Scenarios/ProgressBarStyles.cs
  23. 4 4
      UICatalog/Scenarios/TableEditor.cs
  24. 3 3
      UICatalog/Scenarios/Text.cs
  25. 1 1
      UICatalog/Scenarios/TextAlignments.cs
  26. 1 1
      UICatalog/Scenarios/TextAlignmentsAndDirection.cs
  27. 2 2
      UICatalog/Scenarios/TimeAndDate.cs
  28. 2 2
      UICatalog/Scenarios/TreeViewFileSystem.cs
  29. 4 4
      UICatalog/Scenarios/WizardAsView.cs
  30. 6 6
      UICatalog/Scenarios/Wizards.cs
  31. 3 3
      UnitTests/TopLevels/WizardTests.cs
  32. 4 4
      UnitTests/UICatalog/ScenarioTests.cs
  33. 1 1
      UnitTests/Views/RadioGroupTests.cs
  34. 6 6
      UnitTests/Views/ScrollBarViewTests.cs
  35. 4 4
      UnitTests/Views/TableViewTests.cs
  36. 3 3
      UnitTests/Views/TextFieldTests.cs
  37. 13 13
      UnitTests/Views/TextViewTests.cs
  38. 10 10
      UnitTests/Views/TreeViewTests.cs

+ 2 - 2
Terminal.Gui/Views/DateField.cs

@@ -38,7 +38,7 @@ namespace Terminal.Gui {
 		/// <remarks>
 		///   The passed event arguments containing the old value, new value, and format string.
 		/// </remarks>
-		public event Action<DateTimeEventArgs<DateTime>> DateChanged;
+		public event EventHandler<DateTimeEventArgs<DateTime>> DateChanged;
 
 		/// <summary>
 		///    Initializes a new instance of <see cref="DateField"/> using <see cref="LayoutStyle.Absolute"/> layout.
@@ -418,7 +418,7 @@ namespace Terminal.Gui {
 		/// <param name="args">Event arguments</param>
 		public virtual void OnDateChanged (DateTimeEventArgs<DateTime> args)
 		{
-			DateChanged?.Invoke (args);
+			DateChanged?.Invoke (this,args);
 		}
 	}
 

+ 2 - 2
Terminal.Gui/Views/RadioGroup.cs

@@ -265,7 +265,7 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// Invoked when the selected radio label has changed.
 		/// </summary>
-		public event Action<SelectedItemChangedArgs> SelectedItemChanged;
+		public event EventHandler<SelectedItemChangedArgs> SelectedItemChanged;
 
 		/// <summary>
 		/// 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));
 		}
 
 		///<inheritdoc/>

+ 2 - 2
Terminal.Gui/Views/ScrollBarView.cs

@@ -199,7 +199,7 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// This event is raised when the position on the scrollbar has changed.
 		/// </summary>
-		public event Action ChangedPosition;
+		public event EventHandler ChangedPosition;
 
 		/// <summary>
 		/// The position, relative to <see cref="Size"/>, to set the scrollbar at.
@@ -312,7 +312,7 @@ namespace Terminal.Gui {
 		/// </summary>
 		public virtual void OnChangedPosition ()
 		{
-			ChangedPosition?.Invoke ();
+			ChangedPosition?.Invoke (this, EventArgs.Empty);
 		}
 
 		/// <summary>

+ 4 - 4
Terminal.Gui/Views/TableView.cs

@@ -171,12 +171,12 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// This event is raised when the selected cell in the table changes.
 		/// </summary>
-		public event Action<SelectedCellChangedEventArgs> SelectedCellChanged;
+		public event EventHandler<SelectedCellChangedEventArgs> SelectedCellChanged;
 
 		/// <summary>
 		/// This event is raised when a cell is activated e.g. by double clicking or pressing <see cref="CellActivationKey"/>
 		/// </summary>
-		public event Action<CellActivatedEventArgs> CellActivated;
+		public event EventHandler<CellActivatedEventArgs> CellActivated;
 
 		/// <summary>
 		/// The key which when pressed should trigger <see cref="CellActivated"/> event.  Defaults to Enter.
@@ -1510,7 +1510,7 @@ namespace Terminal.Gui {
 		/// </summary>
 		protected virtual void OnSelectedCellChanged (SelectedCellChangedEventArgs args)
 		{
-			SelectedCellChanged?.Invoke (args);
+			SelectedCellChanged?.Invoke (this,args);
 		}
 
 		/// <summary>
@@ -1519,7 +1519,7 @@ namespace Terminal.Gui {
 		/// <param name="args"></param>
 		protected virtual void OnCellActivated (CellActivatedEventArgs args)
 		{
-			CellActivated?.Invoke (args);
+			CellActivated?.Invoke (this, args);
 		}
 
 		/// <summary>

+ 2 - 2
Terminal.Gui/Views/TextField.cs

@@ -42,7 +42,7 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// Changing event, raised before the <see cref="Text"/> changes and can be canceled or changing the new text.
 		/// </summary>
-		public event Action<TextChangingEventArgs> TextChanging;
+		public event EventHandler<TextChangingEventArgs> TextChanging;
 
 		/// <summary>
 		///   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;
 		}
 

+ 4 - 4
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 <see cref="IsDirty"/>.
 		/// </remarks>
-		public event Action TextChanged;
+		public event EventHandler TextChanged;
 
 		/// <summary>
 		///  Raised when the contents of the <see cref="TextView"/> are changed. 
@@ -1165,7 +1165,7 @@ namespace Terminal.Gui {
 		/// Unlike the <see cref="TextChanged"/> event, this event is raised whenever the user types or
 		/// otherwise changes the contents of the <see cref="TextView"/>.
 		/// </remarks>
-		public event Action<ContentsChangedEventArgs> ContentsChanged;
+		public event EventHandler<ContentsChangedEventArgs> ContentsChanged;
 
 		/// <summary>
 		/// Invoked with the unwrapped <see cref="CursorPosition"/>.
@@ -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 {
 		/// </summary>
 		public virtual void OnContentsChanged ()
 		{
-			ContentsChanged?.Invoke (new ContentsChangedEventArgs (CurrentRow, CurrentColumn));
+			ContentsChanged?.Invoke (this, new ContentsChangedEventArgs (CurrentRow, CurrentColumn));
 		}
 
 		(int width, int height) OffSetBackground ()

+ 5 - 5
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 <see cref="Title"/> is changing. Set <see cref="TitleEventArgs.Cancel"/> to 
 			/// <c>true</c> to cancel the Title change.
 			/// </summary>
-			public event Action<TitleEventArgs> TitleChanging;
+			public event EventHandler<TitleEventArgs> TitleChanging;
 
 			/// <summary>
 			/// Called when the <see cref="Title"/> has been changed. Invokes the <see cref="TitleChanged"/> 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);
 			}
 
 			/// <summary>
 			/// Event fired after the <see cref="Title"/> has been changed. 
 			/// </summary>
-			public event Action<TitleEventArgs> TitleChanged;
+			public event EventHandler<TitleEventArgs> TitleChanged;
 
 			/// <summary>
 			/// Creates a new instance of the <see cref="Tile"/> 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 ();

+ 2 - 2
Terminal.Gui/Views/TimeField.cs

@@ -38,7 +38,7 @@ namespace Terminal.Gui {
 		/// <remarks>
 		///   The passed <see cref="EventArgs"/> is a <see cref="DateTimeEventArgs{T}"/> containing the old value, new value, and format string.
 		/// </remarks>
-		public event Action<DateTimeEventArgs<TimeSpan>> TimeChanged;
+		public event EventHandler<DateTimeEventArgs<TimeSpan>> TimeChanged;
 
 		/// <summary>
 		///    Initializes a new instance of <see cref="TimeField"/> using <see cref="LayoutStyle.Absolute"/> positioning.
@@ -336,7 +336,7 @@ namespace Terminal.Gui {
 		/// <param name="args">The event arguments</param>
 		public virtual void OnTimeChanged (DateTimeEventArgs<TimeSpan> args)
 		{
-			TimeChanged?.Invoke (args);
+			TimeChanged?.Invoke (this,args);
 		}
 	}
 }

+ 2 - 2
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 <see cref="ObjectActivationKey"/>.
 		/// </summary>
-		public event Action<ObjectActivatedEventArgs<T>> ObjectActivated;
+		public event EventHandler<ObjectActivatedEventArgs<T>> ObjectActivated;
 
 		/// <summary>
 		/// Key which when pressed triggers <see cref="TreeView{T}.ObjectActivated"/>.
@@ -712,7 +712,7 @@ namespace Terminal.Gui {
 		/// <param name="e"></param>
 		protected virtual void OnObjectActivated (ObjectActivatedEventArgs<T> e)
 		{
-			ObjectActivated?.Invoke (e);
+			ObjectActivated?.Invoke (this,e);
 		}
 
 		/// <summary>

+ 20 - 20
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 <see cref="Title"/> is changing. Set <see cref="TitleEventArgs.Cancel"/> to 
 			/// <c>true</c> to cancel the Title change.
 			/// </summary>
-			public event Action<TitleEventArgs> TitleChanging;
+			public event EventHandler<TitleEventArgs> TitleChanging;
 
 			/// <summary>
 			/// Called when the <see cref="Title"/> has been changed. Invokes the <see cref="TitleChanged"/> 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);
 			}
 
 			/// <summary>
 			/// Event fired after the <see cref="Title"/> has been changed. 
 			/// </summary>
-			public event Action<TitleEventArgs> TitleChanged;
+			public event EventHandler<TitleEventArgs> 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 <see cref="Wizard"/> is clicked. The Back button is always
 		/// the first button in the array of Buttons passed to the <see cref="Wizard"/> constructor, if any.
 		/// </summary>
-		public event Action<WizardButtonEventArgs> MovingBack;
+		public event EventHandler<WizardButtonEventArgs> MovingBack;
 
 		/// <summary>
 		/// Raised when the Next/Finish button in the <see cref="Wizard"/> is clicked (or the user presses Enter). 
@@ -645,7 +645,7 @@ namespace Terminal.Gui {
 		/// if any. This event is only raised if the <see cref="CurrentStep"/> is the last Step in the Wizard flow 
 		/// (otherwise the <see cref="Finished"/> event is raised).
 		/// </summary>
-		public event Action<WizardButtonEventArgs> MovingNext;
+		public event EventHandler<WizardButtonEventArgs> MovingNext;
 
 		/// <summary>
 		/// Raised when the Next/Finish button in the <see cref="Wizard"/> is clicked. The Next/Finish button is always
@@ -653,7 +653,7 @@ namespace Terminal.Gui {
 		/// raised if the <see cref="CurrentStep"/> is the last Step in the Wizard flow 
 		/// (otherwise the <see cref="Finished"/> event is raised).
 		/// </summary>
-		public event Action<WizardButtonEventArgs> Finished;
+		public event EventHandler<WizardButtonEventArgs> Finished;
 
 		/// <summary>
 		/// Raised when the user has cancelled the <see cref="Wizard"/> by pressin the Esc key. 
@@ -661,7 +661,7 @@ namespace Terminal.Gui {
 		/// closing, cancel the event by setting <see cref="WizardButtonEventArgs.Cancel"/> to 
 		/// <c>true</c> before returning from the event handler.
 		/// </summary>
-		public event Action<WizardButtonEventArgs> Cancelled;
+		public event EventHandler<WizardButtonEventArgs> Cancelled;
 
 		/// <summary>
 		/// <see cref="EventArgs"/> for <see cref="WizardStep"/> events.
@@ -699,12 +699,12 @@ namespace Terminal.Gui {
 		/// This event is raised when the current <see cref="CurrentStep"/>) is about to change. Use <see cref="StepChangeEventArgs.Cancel"/> 
 		/// to abort the transition.
 		/// </summary>
-		public event Action<StepChangeEventArgs> StepChanging;
+		public event EventHandler<StepChangeEventArgs> StepChanging;
 
 		/// <summary>
 		/// This event is raised after the <see cref="Wizard"/> has changed the <see cref="CurrentStep"/>. 
 		/// </summary>
-		public event Action<StepChangeEventArgs> StepChanged;
+		public event EventHandler<StepChangeEventArgs> StepChanged;
 
 		/// <summary>
 		/// Gets or sets the currently active <see cref="WizardStep"/>.
@@ -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;
 		}
 

+ 4 - 4
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);

+ 13 - 13
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);

+ 13 - 13
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);

+ 1 - 1
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;

+ 1 - 1
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 += '*';

+ 4 - 4
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;

+ 2 - 2
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;

+ 1 - 1
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;

+ 2 - 2
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;

+ 4 - 4
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 4 - 4
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;

+ 3 - 3
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<TimeSpan> e)
+		private void TimeChanged (object sender, DateTimeEventArgs<TimeSpan> e)
 		{
 			_labelMirroringTimeField.Text = _timeField.Text;
 		}

+ 1 - 1
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;

+ 1 - 1
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;
 				}

+ 2 - 2
UICatalog/Scenarios/TimeAndDate.cs

@@ -118,14 +118,14 @@ namespace UICatalog.Scenarios {
 			Win.Add (swapButton);
 		}
 
-		private void TimeChanged (DateTimeEventArgs<TimeSpan> e)
+		private void TimeChanged (object sender, DateTimeEventArgs<TimeSpan> e)
 		{
 			lblOldTime.Text = $"Old Time: {e.OldValue}";
 			lblNewTime.Text = $"New Time: {e.NewValue}";
 			lblTimeFmt.Text = $"Time Format: {e.Format}";
 		}
 
-		private void DateChanged (DateTimeEventArgs<DateTime> e)
+		private void DateChanged (object sender, DateTimeEventArgs<DateTime> e)
 		{
 			lblOldDate.Text = $"Old Date: {e.OldValue}";
 			lblNewDate.Text = $"New Date: {e.NewValue}";

+ 2 - 2
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;

+ 4 - 4
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) {

+ 6 - 6
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;

+ 3 - 3
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;
 			};
 

+ 4 - 4
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);
 

+ 1 - 1
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;
 			};

+ 6 - 6
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;

+ 4 - 4
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);

+ 3 - 3
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);

+ 13 - 13
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++;
 			};
 

+ 10 - 10
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;
 			};