@@ -82,13 +82,17 @@ public Style Push() {
8282 /// <see cref="Style"/>.
8383 /// </summary>
8484 /// <param name="msg">The <see cref="String"/> to write.</param>
85- /// <param name="style ">The <see cref="Style "/> to use whilst writing.</param>
85+ /// <param name="writer ">The <see cref="IConsoleWriter "/> to use for writing.</param>
8686 public void Write ( String msg , IConsoleWriter writer ) {
87+ ArgumentNullException . ThrowIfNullOrEmpty ( msg ) ;
88+ writer ??= Writers . NormalConsoleWriter ;
8789 Style old_Style = this . Push ( ) ;
8890 writer . Write ( msg ) ;
8991 _ = old_Style . Push ( ) ;
9092 }
9193 public void WriteLine ( String msg , IConsoleWriter writer ) {
94+ ArgumentNullException . ThrowIfNullOrEmpty ( msg ) ;
95+ writer ??= Writers . NormalConsoleWriter ;
9296 Style old_Style = this . Push ( ) ;
9397 writer . WriteLine ( msg ) ;
9498 _ = old_Style . Push ( ) ;
@@ -100,16 +104,19 @@ public void WriteLine(String msg, IConsoleWriter writer) {
100104 /// </summary>
101105 /// <param name="style">The <see cref="Style"/> to implicitly cast.</param>
102106 public static implicit operator ( ConsoleColor fg , ConsoleColor bg ) ( Style style ) {
107+ ArgumentNullException . ThrowIfNull ( style ) ;
103108 return new ( style . Foreground , style . Background ) ;
104109 }
110+
105111 /// <summary>
106112 /// Explicitly casts a <see cref="Style"/> from a
107113 /// <see cref="ConsoleColor"/> <see cref="Tuple"/>.
108114 /// </summary>
109- /// <param name="tup ">The <see cref="Tuple"/> to cast.</param>
115+ /// <param name="tuple ">The <see cref="Tuple"/> to cast.</param>
110116 public static explicit operator Style ( ( ConsoleColor fg , ConsoleColor bg ) tuple ) {
111117 return new ( ) { Foreground = tuple . fg , Background = tuple . bg } ;
112118 }
119+
113120 /// <summary>
114121 /// Explicitly casts a <see cref="Style"/> from a
115122 /// <see cref="ConsoleColor"/> instance.
@@ -119,6 +126,16 @@ public static explicit operator Style((ConsoleColor fg, ConsoleColor bg) tuple)
119126 public static explicit operator Style ( ConsoleColor color ) {
120127 return new ( color ) ;
121128 }
129+
130+ public ( ConsoleColor fg , ConsoleColor bg ) ToValueTuple ( ) {
131+ throw new NotImplementedException ( ) ;
132+ }
133+
134+ public static Style ToStyle ( Style fg , Style bg ) {
135+ return new ( ) { Foreground = fg , Background = bg } ;
136+ throw new NotImplementedException ( ) ;
137+ }
138+
122139 }
123140 public class Menu {
124141 #region Properties
0 commit comments