main
cs 62 lines 1.9 KB
Raw
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.Extensibility
4 {
5 using WixToolset.Extensibility.Data;
6 using WixToolset.Extensibility.Services;
7
8 /// <summary>
9 /// Base class for creating a resolver extension.
10 /// </summary>
11 public abstract class BaseLayoutExtension : ILayoutExtension
12 {
13 /// <summary>
14 /// Context for use by the extension.
15 /// </summary>
16 protected ILayoutContext Context { get; private set; }
17
18 /// <summary>
19 /// Messaging for use by the extension.
20 /// </summary>
21 protected IMessaging Messaging { get; private set; }
22
23 /// <summary>
24 /// Called at the beginning of layout.
25 /// </summary>
26 public virtual void PreLayout(ILayoutContext context)
27 {
28 this.Context = context;
29
30 this.Messaging = context.ServiceProvider.GetService<IMessaging>();
31 }
32
33 /// <summary>
34 /// See <see cref="ILayoutExtension.CopyFile(string, string)"/>
35 /// </summary>
36 /// <param name="source"></param>
37 /// <param name="destination"></param>
38 /// <returns></returns>
39 public virtual bool CopyFile(string source, string destination)
40 {
41 return false;
42 }
43
44 /// <summary>
45 /// See <see cref="ILayoutExtension.MoveFile(string, string)"/>
46 /// </summary>
47 /// <param name="source"></param>
48 /// <param name="destination"></param>
49 /// <returns></returns>
50 public virtual bool MoveFile(string source, string destination)
51 {
52 return false;
53 }
54
55 /// <summary>
56 /// Called at the end of ayout.
57 /// </summary>
58 public virtual void PostLayout()
59 {
60 }
61 }
62 }