From aebe0c70403a20e7a5b5a2c32669a621b4a30fd3 Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Wed, 12 Mar 2025 15:23:11 -0400 Subject: [PATCH] Documentation-style comments --- Config.cs | 15 +++++++++++++++ Program.cs | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Config.cs b/Config.cs index 6240c9f..a8b74a6 100644 --- a/Config.cs +++ b/Config.cs @@ -1,8 +1,23 @@ namespace PublishTimes; +/// +/// Represents the configuration settings for exporting a schedule, +/// including file name, directory path, and available topics. +/// public class Config { + /// + /// Gets or sets the name of the schedule file. + /// public string? File { get; set; } + + /// + /// Gets or sets the directory path where the schedule file is stored. + /// public string? Path { get; set; } + + /// + /// Gets or sets the list of available topics from the configuration file. + /// public TomlArray? Topics { get; set; } } diff --git a/Program.cs b/Program.cs index 29aec70..1001e23 100644 --- a/Program.cs +++ b/Program.cs @@ -34,6 +34,11 @@ for (int i = 0; i < numberOfArticles; i++) startTime = nextTime; // Update start time for the next article } +/// +/// Converts a TimeSpan into a 12-hour AM/PM formatted time string. +/// +/// The TimeSpan representing the time of day. +/// A formatted string representing the time in AM/PM format. string TimeSpanToAMPM(TimeSpan time) { var minutes = time.TotalMinutes; @@ -46,7 +51,11 @@ string TimeSpanToAMPM(TimeSpan time) return $"{hours12}:{time.Minutes:D2} {period}"; } - +/// +/// Exports the scheduled articles to a file, allowing the user to modify +/// the directory, filename, and list of topics based on +/// a configuration file if available. +/// void ExportSchedule() { var cfgPath = Path.Combine(appDir, cfgFile); @@ -105,6 +114,10 @@ void ExportSchedule() } +/// +/// Displays the scheduled article times in a formatted manner and provides +/// options to export the schedule or restart the scheduling process. +/// void PrintSchedule() { if (isRestart) @@ -138,4 +151,5 @@ void PrintSchedule() } } +// Start the loop PrintSchedule();