PhotoThumbnail/ShellExtensions/PreviewHandlers/PreviewHandlerAttribute.cs
2021-12-28 16:53:45 +08:00

48 lines
1.9 KiB
C#

#if PREVIEW_HANDLER
using System;
namespace ShellExtensions
{
/// <summary>
/// This class attribute is applied to a Preview Handler to specify registration parameters.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class PreviewHandlerAttribute : Attribute
{
/// <summary>
/// Creates a new instance of the attribute.
/// </summary>
/// <param name="name">Name of the Handler</param>
/// <param name="extensions">Semi-colon-separated list of file extensions supported by the handler.</param>
/// <param name="appId">A unique guid used for process isolation.</param>
public PreviewHandlerAttribute(string name, string extensions, string appId)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
Extensions = extensions ?? throw new ArgumentNullException(nameof(extensions));
AppId = appId ?? throw new ArgumentNullException(nameof(appId));
DisableLowILProcessIsolation = false;
}
/// <summary>
/// Gets the name of the handler.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets the semi-colon-separated list of extensions supported by the preview handler.
/// </summary>
public string Extensions { get; private set; }
/// <summary>
/// Gets the AppId associated with the handler for use with the surrogate host process.
/// </summary>
public string AppId { get; private set; }
/// <summary>
/// Disables low integrity-level process isolation.
/// <remarks>This should be avoided as it could be a security risk.</remarks>
/// </summary>
public bool DisableLowILProcessIsolation { get; set; }
}
}
#endif