Files
jdescopingtool/Deprecated/JdeScoping.SecureStoreManager/Services/IDialogService.cs
T
Joseph Doherty 1e21e33ade chore: deprecate standalone SecureStoreManager utility
Move SecureStoreManager project and tests to Deprecated folder and remove
from solution. SecureStore functionality is now integrated into ConfigManager.
2026-01-27 07:26:40 -05:00

65 lines
2.5 KiB
C#

namespace JdeScoping.SecureStoreManager.Services;
/// <summary>
/// Result from unsaved changes prompt.
/// </summary>
public enum UnsavedChangesResult
{
Save,
DontSave,
Cancel
}
/// <summary>
/// Abstraction for platform-specific dialog operations.
/// Enables unit testing of view models that need to show dialogs.
/// </summary>
public interface IDialogService
{
/// <summary>
/// Shows an error message dialog.
/// </summary>
/// <param name="message">The error message to display.</param>
/// <param name="title">The dialog title.</param>
Task ShowErrorAsync(string message, string title);
/// <summary>
/// Shows an informational message dialog.
/// </summary>
/// <param name="message">The informational message to display.</param>
/// <param name="title">The dialog title.</param>
Task ShowInfoAsync(string message, string title);
/// <summary>
/// Shows a confirmation dialog with Yes/No options.
/// </summary>
/// <param name="message">The confirmation message to display.</param>
/// <param name="title">The dialog title.</param>
/// <returns>True if user clicked Yes, false otherwise.</returns>
Task<bool> ShowConfirmationAsync(string message, string title);
/// <summary>
/// Shows a prompt for unsaved changes with Save/Don't Save/Cancel options.
/// </summary>
Task<UnsavedChangesResult> ShowUnsavedChangesPromptAsync();
/// <summary>
/// Shows a save file dialog.
/// </summary>
/// <param name="title">Dialog title.</param>
/// <param name="fileTypeName">Display name for the file type (e.g., "Key Files").</param>
/// <param name="pattern">File pattern (e.g., "*.key").</param>
/// <param name="defaultExtension">Default extension (e.g., ".key").</param>
/// <returns>Selected file path or null if cancelled.</returns>
Task<string?> ShowSaveFileDialogAsync(string title, string fileTypeName, string pattern, string defaultExtension);
/// <summary>
/// Shows an open file dialog.
/// </summary>
/// <param name="title">Dialog title.</param>
/// <param name="fileTypeName">Display name for the file type (e.g., "Key Files").</param>
/// <param name="pattern">File pattern (e.g., "*.key").</param>
/// <returns>Selected file path or null if cancelled.</returns>
Task<string?> ShowOpenFileDialogAsync(string title, string fileTypeName, string pattern);
}