Beispiel #1
0
        static void BuildWorkHorseConfiguration()
        {
            WorkHorseContainer = RootContainer.CreateChildContainer();

            WorkHorseContainer.RegisterType <EditRepositoriesViewModel>(new PerResolveLifetimeManager());
            WorkHorseContainer.RegisterType <EditBranchViewModel>(new PerResolveLifetimeManager());
            WorkHorseContainer.RegisterType <EditBranchDescriptionViewModel>(new PerResolveLifetimeManager());
            WorkHorseContainer.RegisterType <EditMergeRequestViewModel>(new PerResolveLifetimeManager());
            WorkHorseContainer.RegisterType <EditBranchChangesViewModel>(new PerResolveLifetimeManager());
            WorkHorseContainer.RegisterType <EditMergeRequestTestsViewModel>(new PerResolveLifetimeManager());
            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(WorkHorseContainer));
        }
Beispiel #2
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        private void Initialize()
        {
            Container = RootContainer.CreateChildContainer();

            var textViewWrapper = new TextViewWrapper(_textView);

            Container.RegisterInstance <IQualityTextView>(textViewWrapper);
            Container.RegisterInstance(_textView);
            Container.RegisterInstance(_textView.GetAdornmentLayer(nameof(CodeStructureAdorner)));

            var outliningManagerService = RootContainer.Resolve <IOutliningManagerService>();

            Container.RegisterInstance(outliningManagerService);

            Container.RegisterType <IAdornmentSpaceReservation, CodeStructureSpaceReservation>(new ContainerControlledLifetimeManager());
            Container.RegisterType <IDocumentAnalyzerService, DocumentAnalyzerService>(new ContainerControlledLifetimeManager());
            Container.RegisterType <ISyntaxWalkerProvider, SyntaxWalkerProvider>(new ContainerControlledLifetimeManager());
            Container.RegisterType <CodeStructureAdorner>(new ContainerControlledLifetimeManager());
            Container.RegisterType <CodeStructureViewModel>(new ContainerControlledLifetimeManager());
            Container.RegisterType <DiagnosticInfosViewModel>(new ContainerControlledLifetimeManager());

            Container.RegisterType <DiagnosticInfoAdorner>(new ContainerControlledLifetimeManager());
        }