You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,18 @@
11
11
#### Removed
12
12
-->
13
13
14
+
### [1.6.0]
15
+
16
+
#### Added
17
+
*`SleepWithTitle(int duration)` method added instead of `Sleep(int duration)`. It writes sleeping duration into Console's title.
18
+
19
+
#### Changed
20
+
*`Beep(Melody melody)` was checking `Melody` elements with checking duration of beeping and duration of waiting as not being lower than zero. Now it is checking with equal or lower than zero as it should be.
21
+
*`Sleep(int duration)` now only waits instead of writing sleeping duration into screen.
22
+
23
+
#### Fixed
24
+
* Several features were not working due to default values of `ConsoleOptions` and `ScreenColorOptions`. Features like `WriteLine()` or `StartingMethod()` now can be used without calling `StartUp()`.
25
+
14
26
### [1.5.0]
15
27
#### Added
16
28
*`Write<T>(T value, ConsoleColor color, Melody melody)` method is added. You can call it to write colorful text with beeping.
* StartUp() was throwing an error when consoleOption was not provided, now it is fixed.
19
-
* Write<T>(T value, ConsoleColor consoleColor, Melody melody) and WriteLine<T>(T value, ConsoleColor consoleColor, Melody melody) are added.
20
-
* Under Beep(Melody melody) now notes are being null-checked and notes as [frequency-beeping duration-waiting duration] is value range checked.
17
+
v1.6.0
18
+
* Beep(Melody melody) was checking Melody elements with checking duration of beeping and duration of waiting as not being lower than zero. Now it is checking with equal or lower than zero as it should be.
19
+
* SleepWithTitle(int duration) method added instead of Sleep(int duration). It writes sleeping duration into Console's title.
20
+
* Sleep(int duration) now only waits instead of writing sleeping duration into screen.
21
+
* Several features were not working due to default values of ConsoleOptions and ScreenColorOptions. Features like WriteLine() or StartingMethod() now can be used without calling `StartUp()`.
21
22
See changelog (https://github.com/meokullu/HelpConsole/blob/master/CHANGELOG.md)
/// Melody holds integer array with an order of sound frequency, duuration of sound and waiting.
@@ -82,10 +85,10 @@ public static void Beep(Melody melody)
82
85
}
83
86
84
87
// Checking if the beeping duration or waitin duration are positive values.
85
-
if(melody.Notes[i+1]<0||melody.Notes[i+2]<0)
88
+
if(melody.Notes[i+1]<=0||melody.Notes[i+2]<=0)
86
89
{
87
90
//
88
-
WriteLine($"Error on notes. Notes at index: {i+1}/{i+2}{(melody.Notes[i+1]<0?"beeping duration should be greater than 0":"")}{(melody.Notes[i+2]<0?"waiting duration should be greater than 0":"")}");
91
+
WriteLine($"Error on notes. Notes at index: {i+1}/{i+2}{(melody.Notes[i+1]<0?"beeping duration should be greater than 0":"")}{(melody.Notes[i+2]<0?"waiting duration should be greater than 0":"")}");
89
92
90
93
//
91
94
continue;
@@ -104,20 +107,31 @@ public static void Beep(Melody melody)
104
107
}
105
108
106
109
/// <summary>
107
-
/// Sleep uses <see cref="Thread.Sleep(int)"/>, writes Sleeping {duration} ms to console's title via <see cref="SetConsoleTitle(string)"/>.
110
+
/// Sleep uses <see cref="Thread.Sleep(int)"/>.
108
111
/// </summary>
109
112
/// <param name="duration">Time in milliseconds.</param>
110
113
//[SupportedOSPlatform("windows")]
111
114
publicstaticvoidSleep(intduration)
115
+
{
116
+
// Sleeping.
117
+
Thread.Sleep(duration);
118
+
}
119
+
120
+
/// <summary>
121
+
/// Sleep uses <see cref="Thread.Sleep(int)"/>, writes Sleeping {duration} s/ms to console's title via <see cref="SetConsoleTitle(string)"/>.
122
+
/// </summary>
123
+
/// <param name="duration">Time in milliseconds.</param>
124
+
//[SupportedOSPlatform("windows")]
125
+
publicstaticvoidSleepWithTitle(intduration)
112
126
{
113
127
// Save console title into temporary variable.
114
128
stringtempTitle=Console.Title;
115
129
116
130
// Set console title specified with duration to indicate sleeping.
0 commit comments