-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExportLogsCommand.cs
More file actions
49 lines (42 loc) · 1.34 KB
/
ExportLogsCommand.cs
File metadata and controls
49 lines (42 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace S7Tools.Core.Commands;
/// <summary>
/// Options for exporting logs.
/// </summary>
public class ExportLogsOptions
{
/// <summary>
/// Gets or sets the file name for export.
/// </summary>
public string FileName { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the export format (txt, json, csv).
/// </summary>
public string Format { get; set; } = "txt";
/// <summary>
/// Gets or sets the start date for filtering logs.
/// </summary>
public DateTimeOffset? StartDate { get; set; }
/// <summary>
/// Gets or sets the end date for filtering logs.
/// </summary>
public DateTimeOffset? EndDate { get; set; }
}
/// <summary>
/// Command to export logs with given options.
/// </summary>
public class ExportLogsCommand : ICommand<CommandResult<string>>
{
/// <summary>
/// Gets the export options.
/// </summary>
public ExportLogsOptions Options { get; }
/// <summary>
/// Gets the unique identifier for this command type.
/// </summary>
public string CommandType => nameof(ExportLogsCommand);
/// <summary>
/// Initializes a new instance of the <see cref="ExportLogsCommand"/> class.
/// </summary>
/// <param name="options">The export options.</param>
public ExportLogsCommand(ExportLogsOptions options) => Options = options;
}