| 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 BaseBinderExtension : IBinderExtension |
| 12 | { |
| 13 | /// <summary> |
| 14 | /// Context for use by the extension. |
| 15 | /// </summary> |
| 16 | protected IBindContext 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 | /// BackendHelper for use by the extension. |
| 25 | /// </summary> |
| 26 | protected IBackendHelper BackendHelper { get; private set; } |
| 27 | |
| 28 | /// <summary> |
| 29 | /// Called at the beginning of bind. |
| 30 | /// </summary> |
| 31 | public virtual void PreBind(IBindContext context) |
| 32 | { |
| 33 | this.Context = context; |
| 34 | |
| 35 | this.Messaging = context.ServiceProvider.GetService<IMessaging>(); |
| 36 | |
| 37 | this.BackendHelper = context.ServiceProvider.GetService<IBackendHelper>(); |
| 38 | } |
| 39 | |
| 40 | /// <summary> |
| 41 | /// Called at the end of bind. |
| 42 | /// </summary> |
| 43 | public virtual void PostBind(IBindResult result) |
| 44 | { |
| 45 | } |
| 46 | } |
| 47 | } |