24 lines
644 B
C#
24 lines
644 B
C#
using Autofac;
|
|
using MfGames.Nitride.Temporal.Setup;
|
|
|
|
namespace MfGames.Nitride.Calendar;
|
|
|
|
public static class NitrideCalendarBuilderExtensions
|
|
{
|
|
private static bool loaded;
|
|
|
|
public static NitrideBuilder UseCalendar(this NitrideBuilder builder)
|
|
{
|
|
// If we've already loaded, then we have a problem.
|
|
if (loaded)
|
|
{
|
|
throw new InvalidOperationException("Cannot use UseCalendar() more than once.");
|
|
}
|
|
|
|
loaded = true;
|
|
|
|
// Get the configuration so we can set the various options.
|
|
return builder.ConfigureContainer(x => x.RegisterModule<NitrideCalendarModule>());
|
|
}
|
|
}
|