using Valg.EVA.Skanning.ContainerExtensions;
using Valg.EVA.Skanning.UserInterfaceElements.LightBox;
using Valg.EVA.Skanning.UserInterfaceElements.TopBar;
using Unity;
using Valg.EVA.Skanning.UserInterfaceElements.UserSettingWindow;
using Valg.EVA.Skanning.Verify.Startup.AdditionalSettings;
using Valg.EVA.Skanning.Verify.Startup.BoxComplete;
using Valg.EVA.Skanning.Verify.Startup.BoxIsLocked;
using Valg.EVA.Skanning.Verify.Startup.Filter;
using Valg.EVA.Skanning.Verify.Startup.NavigationTip;
using Valg.EVA.Skanning.Verify.Startup.PlacementInBox;
using Valg.EVA.Skanning.Verify.Startup.Preview;
using Valg.EVA.Skanning.Verify.Startup.StartPage;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.BallotNumber;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.BallotPaperStatus;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.BallotPaperXOfY;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.Candidate;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.Header;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.VerifiableViewModelsCollection;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.Messages;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.PageXOfY;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.ReadModel;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.RenumberStrikeout;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.Stamp;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.WriteIns;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.WriteModel;
using Valg.EVA.Skanning.Verify.Startup.VerifyWindow;

namespace Valg.EVA.Skanning.Verify.Startup
{
    public class UnityInstaller : IUnityInstaller
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
        public void Install(IUnityContainer unityContainer)
        {
            unityContainer.RegisterType<IVerifyWindowViewModel, VerifyWindowViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IMainWindowInitializer, MainWindowInitializer>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IVerifyWindow, VerifyWindow.VerifyWindow>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IVerifyBallotPaperViewModel, VerifyBallotPaperViewModel>();
            unityContainer.RegisterType<PersonVoteContextMenuCommand>();
            unityContainer.RegisterType<RenumberStrikeoutContextMenuCommand>();
            unityContainer.RegisterType<CandidateViewModel>();
            unityContainer.RegisterType<INavigationTipWindow, NavigationTip.NavigationTipWindow>();
            unityContainer.RegisterType<INavigationTipViewModel, NavigationTipViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IPageXOfYViewModel, PageXOfYViewModel>();
            unityContainer.RegisterType<VerifyStartPageViewModel>();
            unityContainer.RegisterType<VerificationOverviewViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IPreviewViewModel, PreviewViewModel>();
            unityContainer.RegisterType<StartPageBoxToVerifyViewModel>();
            unityContainer.RegisterType<MiniBoxCountingInformationViewModel>();
            unityContainer.RegisterType<LightBoxViewModel>();
            unityContainer.RegisterType<IVerifiableViewModelsCollectionVisitor, VerifiableViewModelsCollectionVisitor>();
            unityContainer.RegisterType<IBallotCompleteViewModel, BallotCompleteViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IEndOfVisitationCycleViewModel, EndOfVisitationCycleViewModel>();
            unityContainer.RegisterType<IWriteModelHub, WriteModelHub>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IReadModelHub, ReadModelHub>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IBoxCompleteViewModel, BoxCompleteViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<INavigateBallotsViewModel, NavigateBallotsViewModel>();
            unityContainer.RegisterType<IBallotPaperXOfYViewModel, BallotPaperXOfYViewModel>();
            unityContainer.RegisterType<IStampVerificationPageViewModel, StampVerificationPageViewModel>();
            unityContainer.RegisterType<IBallotNumberViewModel, BallotNumberViewModel>();
            unityContainer.RegisterType<IAffiliationHeaderViewModel, AffiliationHeaderViewModel>();
            unityContainer.RegisterType<ActiveMainControlManager>();
            unityContainer.RegisterType<IWriteInPageViewModel, WriteInPageViewModel>();
            unityContainer.RegisterType<TopBarViewModel>();
            unityContainer.RegisterType<IVerifyBallotPaperSubPagesViewModelsBuilder, VerifyBallotPaperSubPagesViewModelsBuilder>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IVerificationProcessErrorsAndWarnings, VerificationProcessErrorsAndWarnings>();
            unityContainer.RegisterType<IBallotPaperStatusViewModel, BallotPaperStatusViewModel>();
            unityContainer.RegisterType<IUnknownBallotInformationViewModel, UnknownBallotInformationViewModel>();
            unityContainer.RegisterType<IPlacementInBoxViewModel, PlacementInBoxViewModel>();
            unityContainer.RegisterType<FilterViewModel>();
            unityContainer.RegisterType<IAdditionalSettingsProvider, AdditionalSettingsProvider>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<RenumberStrikeoutViewModel>();
            unityContainer.RegisterType<AutoVerifyHandler>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IAutoVerifyInfoViewModel, AutoVerifyInfoViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
        }
    }
}
