2121using System . Collections . Generic ;
2222using System . Globalization ;
2323
24+ #nullable enable
25+
2426namespace OpenQA . Selenium . Interactions
2527{
2628 /// <summary>
2729 /// Base class for all input devices for actions.
2830 /// </summary>
2931 public abstract class InputDevice
3032 {
31- private string deviceName ;
32-
3333 /// <summary>
3434 /// Initializes a new instance of the <see cref="InputDevice"/> class.
3535 /// </summary>
3636 /// <param name="deviceName">The unique name of the input device represented by this class.</param>
37+ /// <exception cref="ArgumentException">If <paramref name="deviceName"/> is <see langword="null"/> or <see cref="string.Empty"/>.</exception>
3738 protected InputDevice ( string deviceName )
3839 {
3940 if ( string . IsNullOrEmpty ( deviceName ) )
4041 {
4142 throw new ArgumentException ( "Device name must not be null or empty" , nameof ( deviceName ) ) ;
4243 }
4344
44- this . deviceName = deviceName ;
45+ this . DeviceName = deviceName ;
4546 }
4647
4748 /// <summary>
4849 /// Gets the unique name of this input device.
4950 /// </summary>
50- public string DeviceName
51- {
52- get { return this . deviceName ; }
53- }
51+ public string DeviceName { get ; }
5452
5553 /// <summary>
5654 /// Gets the kind of device for this input device.
@@ -90,7 +88,7 @@ public Interaction CreatePause(TimeSpan duration)
9088 /// <returns>A hash code for the current <see cref="InputDevice"/>.</returns>
9189 public override int GetHashCode ( )
9290 {
93- return this . deviceName . GetHashCode ( ) ;
91+ return this . DeviceName . GetHashCode ( ) ;
9492 }
9593
9694 /// <summary>
@@ -99,7 +97,7 @@ public override int GetHashCode()
9997 /// <returns>A string that represents the current <see cref="InputDevice"/>.</returns>
10098 public override string ToString ( )
10199 {
102- return string . Format ( CultureInfo . InvariantCulture , "{0} input device [name: {1}]" , this . DeviceKind , this . deviceName ) ;
100+ return string . Format ( CultureInfo . InvariantCulture , "{0} input device [name: {1}]" , this . DeviceKind , this . DeviceName ) ;
103101 }
104102 }
105103}
0 commit comments