aboutsummaryrefslogtreecommitdiff
path: root/src/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs
blob: 672e17eed0cee11635b99e2754b8d09eb6b92947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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.

[assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.EarliestCoreMBA.EarliestCoreBAFactory))]
namespace Example.EarliestCoreMBA
{
    using WixToolset.Mba.Core;

    public class EarliestCoreBAFactory : BaseBootstrapperApplicationFactory
    {
        private static int loadCount = 0;

        protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand)
        {
            if (loadCount > 0)
            {
                engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)");
            }
            ++loadCount;
            return new EarliestCoreBA(engine);
        }
    }
}