/
FileType.cs
53 lines (48 loc) · 2.73 KB
/
FileType.cs
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
// Copyright Bastian Eicher et al.
// Licensed under the GNU Lesser Public License
namespace ZeroInstall.DesktopIntegration.Unix;
/// <summary>
/// Contains control logic for applying <see cref="Model.Capabilities.FileType"/> and <see cref="AccessPoints.FileType"/> on FreeDesktop.org systems.
/// </summary>
public static class FileType
{
#region Register
/// <summary>
/// Registers a file type in the current system.
/// </summary>
/// <param name="target">The application being integrated.</param>
/// <param name="fileType">The file type to register.</param>
/// <param name="machineWide">Register the file type machine-wide instead of just for the current user.</param>
/// <param name="iconStore">Stores icon files downloaded from the web as local files.</param>
/// <param name="accessPoint">Indicates that the file associations shall become default handlers for their respective types.</param>
/// <exception cref="OperationCanceledException">The user canceled the task.</exception>
/// <exception cref="IOException">A problem occurred while writing to the filesystem.</exception>
/// <exception cref="WebException">A problem occurred while downloading additional data (such as icons).</exception>
/// <exception cref="UnauthorizedAccessException">Write access to the filesystem is not permitted.</exception>
public static void Register(FeedTarget target, Model.Capabilities.FileType fileType, IIconStore iconStore, bool machineWide, bool accessPoint = false)
{
#region Sanity checks
if (fileType == null) throw new ArgumentNullException(nameof(fileType));
if (iconStore == null) throw new ArgumentNullException(nameof(iconStore));
#endregion
// TODO: Implement
}
#endregion
#region Unregister
/// <summary>
/// Unregisters a file type in the current system.
/// </summary>
/// <param name="fileType">The file type to remove.</param>
/// <param name="machineWide">Unregister the file type machine-wide instead of just for the current user.</param>
/// <param name="accessPoint">Indicates that the file associations were default handlers for their respective types.</param>
/// <exception cref="IOException">A problem occurred while writing to the filesystem.</exception>
/// <exception cref="UnauthorizedAccessException">Write access to the filesystem is not permitted.</exception>
public static void Unregister(Model.Capabilities.FileType fileType, bool machineWide, bool accessPoint = false)
{
#region Sanity checks
if (fileType == null) throw new ArgumentNullException(nameof(fileType));
#endregion
// TODO: Implement
}
#endregion
}