@@ -16,11 +16,11 @@ public static void Main()
16
16
String . Format ( "You pressed {0}" , input . Key . ToString ( ) ) ) ;
17
17
bool modifiers = false ;
18
18
19
- if ( ( input . Modifiers & ConsoleModifiers . Alt ) == ConsoleModifiers . Alt ) {
19
+ if ( input . Modifiers . HasFlag ( ConsoleModifiers . Alt ) ) {
20
20
output . Append ( ", together with " + ConsoleModifiers . Alt . ToString ( ) ) ;
21
21
modifiers = true ;
22
22
}
23
- if ( ( input . Modifiers & ConsoleModifiers . Control ) == ConsoleModifiers . Control )
23
+ if ( input . Modifiers . HasFlag ( ConsoleModifiers . Control ) )
24
24
{
25
25
if ( modifiers ) {
26
26
output . Append ( " and " ) ;
@@ -31,7 +31,7 @@ public static void Main()
31
31
}
32
32
output . Append ( ConsoleModifiers . Control . ToString ( ) ) ;
33
33
}
34
- if ( ( input . Modifiers & ConsoleModifiers . Shift ) == ConsoleModifiers . Shift )
34
+ if ( input . Modifiers . HasFlag ( ConsoleModifiers . Shift ) )
35
35
{
36
36
if ( modifiers ) {
37
37
output . Append ( " and " ) ;
@@ -49,23 +49,23 @@ public static void Main()
49
49
}
50
50
}
51
51
// The output from a sample console session might appear as follows:
52
- // Press a key, along with Alt, Ctrl, or Shift.
52
+ // Press a key, together with Alt, Ctrl, or Shift.
53
53
// Press Esc to exit.
54
54
// You pressed D.
55
55
//
56
- // Press a key, along with Alt, Ctrl, or Shift.
56
+ // Press a key, together with Alt, Ctrl, or Shift.
57
57
// Press Esc to exit.
58
- // You pressed X, along with Shift.
58
+ // You pressed X, together with Shift.
59
59
//
60
- // Press a key, along with Alt, Ctrl, or Shift.
60
+ // Press a key, together with Alt, Ctrl, or Shift.
61
61
// Press Esc to exit.
62
- // You pressed L, along with Control and Shift.
62
+ // You pressed L, together with Control and Shift.
63
63
//
64
- // Press a key, along with Alt, Ctrl, or Shift.
64
+ // Press a key, together with Alt, Ctrl, or Shift.
65
65
// Press Esc to exit.
66
- // You pressed P, along with Alt and Control and Shift.
66
+ // You pressed P, together with Alt and Control and Shift.
67
67
//
68
- // Press a key, along with Alt, Ctrl, or Shift.
68
+ // Press a key, together with Alt, Ctrl, or Shift.
69
69
// Press Esc to exit.
70
70
// You pressed Escape.
71
71
// </Snippet1>
0 commit comments