12345678910111213141516171819202122232425262728 |
- using PicView.Core.FileAssociations;
- namespace PicView.Core.MacOS.FileAssociation;
- /// <summary>
- /// macOS-specific implementation of IFileAssociationService
- /// </summary>
- public class MacFileAssociationService : IFileAssociationService
- {
- public async Task<bool> RegisterFileAssociation(string extension, string description) =>
- await FileAssociationHelper.RegisterFileAssociation(extension, "public.image");
-
- public async Task<bool> UnregisterFileAssociation(string extension) =>
- await FileAssociationHelper.UnregisterFileAssociationMacOS(extension);
-
- public async Task<bool> IsFileAssociated(string extension)
- {
- // Since the macOS implementation doesn't have an "IsFileAssociated" method yet,
- // we'll need to implement it. Here's a placeholder
-
- // Implementation for checking file association status on macOS would go here
- // This could involve checking the Launch Services database
- await Task.CompletedTask; // Just to make this async
-
- // For now, return a placeholder value
- return false;
- }
- }
|