diff options
Diffstat (limited to '')
-rw-r--r-- | src/dtf/WixToolset.Dtf.WindowsInstaller/CustomActionAttribute.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/dtf/WixToolset.Dtf.WindowsInstaller/CustomActionAttribute.cs b/src/dtf/WixToolset.Dtf.WindowsInstaller/CustomActionAttribute.cs new file mode 100644 index 00000000..d9bdb71b --- /dev/null +++ b/src/dtf/WixToolset.Dtf.WindowsInstaller/CustomActionAttribute.cs | |||
@@ -0,0 +1,55 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Dtf.WindowsInstaller | ||
4 | { | ||
5 | using System; | ||
6 | using System.Reflection; | ||
7 | |||
8 | /// <summary> | ||
9 | /// Marks a method as a custom action entry point. | ||
10 | /// </summary> | ||
11 | /// <remarks><p> | ||
12 | /// A custom action method must be defined as public and static, | ||
13 | /// take a single <see cref="Session"/> object as a parameter, | ||
14 | /// and return an <see cref="ActionResult"/> enumeration value. | ||
15 | /// </p></remarks> | ||
16 | [Serializable, AttributeUsage(AttributeTargets.Method)] | ||
17 | public sealed class CustomActionAttribute : Attribute | ||
18 | { | ||
19 | /// <summary> | ||
20 | /// Name of the custom action entrypoint, or null if the same as the method name. | ||
21 | /// </summary> | ||
22 | private string name; | ||
23 | |||
24 | /// <summary> | ||
25 | /// Marks a method as a custom action entry point. | ||
26 | /// </summary> | ||
27 | public CustomActionAttribute() | ||
28 | : this(null) | ||
29 | { | ||
30 | } | ||
31 | |||
32 | /// <summary> | ||
33 | /// Marks a method as a custom action entry point. | ||
34 | /// </summary> | ||
35 | /// <param name="name">Name of the function to be exported, | ||
36 | /// defaults to the name of this method</param> | ||
37 | public CustomActionAttribute(string name) | ||
38 | { | ||
39 | this.name = name; | ||
40 | } | ||
41 | |||
42 | /// <summary> | ||
43 | /// Gets or sets the name of the custom action entrypoint. A null | ||
44 | /// value defaults to the name of the method. | ||
45 | /// </summary> | ||
46 | /// <value>name of the custom action entrypoint, or null if none was specified</value> | ||
47 | public string Name | ||
48 | { | ||
49 | get | ||
50 | { | ||
51 | return this.name; | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | } | ||