tznind 2 anni fa
parent
commit
1491e01d6a

+ 5 - 0
Terminal.Gui/Core/EventArgs/KeyChangedEventArgs.cs

@@ -20,6 +20,11 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		public Key NewKey { get; }
 		public Key NewKey { get; }
 
 
+		/// <summary>
+		/// Creates a new instance of the <see cref="KeyChangedEventArgs"/> class
+		/// </summary>
+		/// <param name="oldKey"></param>
+		/// <param name="newKey"></param>
 		public KeyChangedEventArgs (Key oldKey, Key newKey)
 		public KeyChangedEventArgs (Key oldKey, Key newKey)
 		{
 		{
 			this.OldKey = oldKey;
 			this.OldKey = oldKey;

+ 10 - 4
Terminal.Gui/Core/EventArgs/RunStateEventArgs.cs

@@ -1,18 +1,24 @@
 using System;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using static Terminal.Gui.Application;
 using static Terminal.Gui.Application;
 
 
 namespace Terminal.Gui {
 namespace Terminal.Gui {
+	/// <summary>
+	/// Event arguments for events about <see cref="RunState"/>
+	/// </summary>
 	public class RunStateEventArgs : EventArgs {
 	public class RunStateEventArgs : EventArgs {
 
 
+		/// <summary>
+		/// Creates a new instance of the <see cref="RunStateEventArgs"/> class
+		/// </summary>
+		/// <param name="state"></param>
 		public RunStateEventArgs (RunState state)
 		public RunStateEventArgs (RunState state)
 		{
 		{
 			State = state;
 			State = state;
 		}
 		}
 
 
+		/// <summary>
+		/// The state being reported on by the event
+		/// </summary>
 		public RunState State { get; }
 		public RunState State { get; }
 	}
 	}
 }
 }

+ 14 - 5
Terminal.Gui/Core/EventArgs/SizeChangedEventArgs.cs

@@ -1,17 +1,26 @@
 using System;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 
-namespace Terminal.Gui{
+namespace Terminal.Gui {
+
+	/// <summary>
+	/// Args for events about about Size (e.g. Resized)
+	/// </summary>
 	public class SizeChangedEventArgs : EventArgs {
 	public class SizeChangedEventArgs : EventArgs {
 
 
+		/// <summary>
+		/// Creates a new instance of the <see cref="SizeChangedEventArgs"/> class.
+		/// </summary>
+		/// <param name="size"></param>
 		public SizeChangedEventArgs (Size size)
 		public SizeChangedEventArgs (Size size)
 		{
 		{
 			Size = size;
 			Size = size;
 		}
 		}
 
 
+		/// <summary>
+		/// Gets the size the event describes.  This should
+		/// reflect the new/current size after the event
+		/// resolved.
+		/// </summary>
 		public Size Size { get; }
 		public Size Size { get; }
 	}
 	}
 }
 }

+ 7 - 0
Terminal.Gui/Core/EventArgs/ToplevelEventArgs.cs

@@ -1,8 +1,15 @@
 using System;
 using System;
 
 
 namespace Terminal.Gui {
 namespace Terminal.Gui {
+	/// <summary>
+	/// Args for events that relate to a specific <see cref="Toplevel"/>.
+	/// </summary>
 	public class ToplevelEventArgs : EventArgs{
 	public class ToplevelEventArgs : EventArgs{
 
 
+		/// <summary>
+		/// Creates a new instance of the <see cref="ToplevelClosingEventArgs"/> class.
+		/// </summary>
+		/// <param name="toplevel"></param>
 		public ToplevelEventArgs (Toplevel toplevel)
 		public ToplevelEventArgs (Toplevel toplevel)
 		{
 		{
 			Toplevel = toplevel;
 			Toplevel = toplevel;

+ 18 - 0
Terminal.Gui/Core/EventArgs/ViewEventArgs.cs

@@ -5,12 +5,30 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
 namespace Terminal.Gui{
 namespace Terminal.Gui{
+
+	/// <summary>
+	/// Args for events that relate to specific <see cref="View"/>
+	/// </summary>
 	public class ViewEventArgs :EventArgs{
 	public class ViewEventArgs :EventArgs{
+
+		/// <summary>
+		/// Creates a new instance of the <see cref="ViewEventArgs"/> class.
+		/// </summary>
+		/// <param name="view"></param>
 		public ViewEventArgs (View view)
 		public ViewEventArgs (View view)
 		{
 		{
 			View = view;
 			View = view;
 		}
 		}
 
 
+		/// <summary>
+		/// The view that the event is about.
+		/// </summary>
+		/// <remarks>
+		/// Can be different from the sender of the <see cref="EventHandler"/>
+		/// for example if event describes the adding a child then sender may
+		/// be the parent while <see cref="View"/> is the child
+		/// being added.
+		/// </remarks>
 		public View View { get; }
 		public View View { get; }
 	}
 	}
 }
 }

+ 1 - 1
Terminal.Gui/Core/View.cs

@@ -1370,7 +1370,7 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// <summary>
 		/// Method invoked when a subview is being removed from this view.
 		/// Method invoked when a subview is being removed from this view.
 		/// </summary>
 		/// </summary>
-		/// <param name="view">The subview being removed.</param>
+		/// <param name="e">Event args describing the subview being removed.</param>
 		public virtual void OnRemoved (ViewEventArgs e)
 		public virtual void OnRemoved (ViewEventArgs e)
 		{
 		{
 			var view = e.View;
 			var view = e.View;

+ 1 - 1
UnitTests/Views/TableViewTests.cs

@@ -1652,7 +1652,7 @@ namespace Terminal.Gui.ViewTests {
 
 
 			Assert.Equal(4,tableView.GetAllSelectedCells().Count());
 			Assert.Equal(4,tableView.GetAllSelectedCells().Count());
 			tableView.ProcessKey (new KeyEvent { Key = Key.Space });
 			tableView.ProcessKey (new KeyEvent { Key = Key.Space });
-			Assert.Equal(1,tableView.GetAllSelectedCells().Count());
+			Assert.Single(tableView.GetAllSelectedCells());
 		}
 		}