-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDialogHelper.cs
More file actions
111 lines (91 loc) · 3.45 KB
/
DialogHelper.cs
File metadata and controls
111 lines (91 loc) · 3.45 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using System;
using System.Windows;
namespace TaskPilot
{
/// <summary>
/// Utility-Klasse für zentrale Dialog- und MessageBox-Verwaltung
/// </summary>
public static class DialogHelper
{
public static void ShowInfo(string message, string title = "Information")
{
MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Information);
}
public static void ShowWarning(string message, string title = "Warnung")
{
MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Warning);
}
public static void ShowError(string message, string title = "Fehler")
{
MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Error);
}
public static MessageBoxResult ShowConfirm(string message, string title = "Bestätigung")
{
return MessageBox.Show(message, title, MessageBoxButton.YesNo, MessageBoxImage.Question);
}
public static void ShowConfigurationLoaded(int count)
{
ShowInfo($"Konfiguration geladen: {count} Programme");
}
public static void ShowConfigurationReloaded()
{
ShowInfo("Konfiguration neu geladen.");
}
public static void ShowNewProcessesLoaded()
{
ShowInfo("Neue Prozesse geladen.");
}
public static void ShowConfigurationSaved(int count)
{
ShowInfo($"Konfiguration erfolgreich gespeichert.\n{count} Programme werden überwacht.");
}
public static void ShowProcessesAdded(int count)
{
ShowInfo($"Konfiguration erfolgreich gespeichert.\n{count} Prozesse hinzugefügt.");
}
public static void ShowProcessListUpdated()
{
ShowInfo("Prozessliste aktualisiert.");
}
public static void ShowStartCommandsSaved()
{
ShowInfo("Startbefehle gespeichert.");
}
public static void ShowSelectAtLeastOneProcess()
{
ShowWarning("Bitte wählen Sie mindestens einen Prozess aus.");
}
public static void ShowValidationError(string details)
{
ShowWarning($"Validierungsfehler\n\n{details}");
}
public static void ShowConfigurationError(string message)
{
ShowError($"Fehler beim Laden der Konfiguration:\n{message}");
}
public static void ShowOperationError(string operation, string message)
{
ShowError($"Fehler beim {operation}:\n{message}");
}
public static void ShowOperationError(string operation, Exception ex)
{
ShowError($"Fehler beim {operation}:\n{ex.Message}");
}
public static MessageBoxResult AskRemoveAllProcesses()
{
return ShowConfirm("Sind Sie sicher, dass Sie alle Prozesse entfernen möchten?");
}
public static void ShowNewProcessAdded(string processName)
{
ShowInfo($"Prozess '{processName}' erfolgreich hinzugefügt.");
}
public static MessageBoxResult AskDeleteProcess(string processName)
{
return ShowConfirm($"Sind Sie sicher, dass Sie '{processName}' aus der Liste löschen möchten?");
}
public static void ShowProcessDeleted(string processName)
{
ShowInfo($"Prozess '{processName}' wurde aus der Liste gelöscht.");
}
}
}