aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Extensibility/BaseResolverExtension.cs
blob: 9498d126250043f631205c063076c97997bd4481 (plain)
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
// 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.

namespace WixToolset.Extensibility
{
    using WixToolset.Data;
    using WixToolset.Data.Bind;

    /// <summary>
    /// Base class for creating a resolver extension.
    /// </summary>
    public abstract class BaseResolverExtension : IResolverExtension
    {
        /// <summary>
        /// Context for use by the extension.
        /// </summary>
        protected IResolveContext Context { get; private set; }

        /// <summary>
        /// Called at the beginning of the resolving variables and files.
        /// </summary>
        public virtual void PreResolve(IResolveContext context)
        {
            this.Context = context;
        }

        public virtual string ResolveFile(string source, IntermediateTupleDefinition tupleDefinition, SourceLineNumber sourceLineNumbers, BindStage bindStage)
        {
            return null;
        }

        /// <summary>
        /// Called at the end of resolve.
        /// </summary>
        public virtual void PostResolve(ResolveResult result)
        {
        }
    }
}