-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathEventSource.cs
More file actions
76 lines (71 loc) · 2.52 KB
/
EventSource.cs
File metadata and controls
76 lines (71 loc) · 2.52 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System.Xml.Linq;
using WixSharp.CommonTasks;
namespace WixSharp
{
/// <summary>
/// Defines Event source for windows Event Log service.
/// </summary>
/// <seealso cref="WixSharp.WixEntity" />
/// <seealso cref="WixSharp.IGenericEntity" />
///<example>The following is an example of creating an event source "ROOT Builder".
///<code>
///var project =
/// new Project("MyProduct",
/// new Dir(@"%ProgramFiles64Folder%\My Company\My Product",
/// new EventSource
/// {
/// Name = "ROOT Builder",
/// Log = "Application",
/// EventMessageFile = @"%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll"
/// },
/// ...
///
/// project.BuildMsi();
/// </code>
/// </example>
public class EventSource : WixEntity, IGenericEntity
{
/// <summary>
/// Name of the event source.
/// </summary>
[Xml]
new public string Name;
/// <summary>
/// Name of the event source's log.
/// </summary>
[Xml]
public string Log;
/// <summary>
/// Creates an event source.
/// </summary>
///<example>The following is an example of creating an event source "ROOT Boilder".
///<code>
///var project =
/// new Project("MyProduct",
/// new Dir(@"%ProgramFiles64Folder%\My Company\My Product",
/// new EventSource
/// {
/// Name = "ROOT Builder",
/// Log = "Application",
/// EventMessageFile = @"%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll"
/// },
/// ...
///
/// project.BuildMsi();
/// </code>
/// </example>
[Xml]
public string EventMessageFile;
/// <summary>
/// Adds itself as an XML content into the WiX source being generated from the <see cref="WixSharp.Project"/>.
/// See 'Wix#/samples/Extensions' sample for the details on how to implement this interface correctly.
/// </summary>
/// <param name="context">The context.</param>
public void Process(ProcessingContext context)
{
context.Project.Include(WixExtension.Util);
XElement component = this.CreateAndInsertParentComponent(context);
component.Add(this.ToXElement(WixExtension.Util, "EventSource"));
}
}
}