mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-19 02:12:49 +08:00

Removed the verbs from all extension methods that manipulate properties which makes the API more succinct and easier to read. Also added implicit conversion from string to Style. As a good OSS citizen, I've obsoleted the old methods with a warning for now, so this shouldn't break anyone using the old methods.
20 lines
601 B
C#
20 lines
601 B
C#
using Spectre.Console;
|
|
|
|
namespace Calendars
|
|
{
|
|
public static class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
AnsiConsole.WriteLine();
|
|
AnsiConsole.Render(new Calendar(2020, 10)
|
|
.RoundedBorder()
|
|
.HighlightStyle(Style.Parse("red"))
|
|
.HeaderStyle(Style.Parse("yellow"))
|
|
.AddCalendarEvent("An event", 2020, 9, 22)
|
|
.AddCalendarEvent("Another event", 2020, 10, 2)
|
|
.AddCalendarEvent("A third event", 2020, 10, 13));
|
|
}
|
|
}
|
|
}
|