Example #1
0
        public ProjectScopeFactory()
        {
            dteReference = new SynchInitializedInstance <DteWithEvents>(
                () =>
            {
                var dtex = new DteWithEvents(VsxHelper.GetDte(ServiceProvider));
                dtex.SolutionEvents.AfterClosing += OnSolutionClosed;
                VisualStudioTracer.Trace("subscribed to solution closed " + Thread.CurrentThread.ManagedThreadId, "ProjectScopeFactory");
                return(dtex);
            });

            classificationsReference = new SynchInitializedInstance <GherkinFileEditorClassifications>(
                () => new GherkinFileEditorClassifications(ClassificationRegistry));

            projectScopeCache = new SynchronizedResultCache <Project, string, IProjectScope>(
                project => new VsProjectScope(project, dteReference.Value, classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider, BindingSkeletonProviderFactory),
                VsxHelper.GetProjectUniqueId);

            noProjectScopeReference = new SynchInitializedInstance <NoProjectScope>(() =>
                                                                                    new NoProjectScope(classificationsReference.Value, VisualStudioTracer));
        }
        public ProjectScopeFactory()
        {
            dteReference = new SynchInitializedInstance<DteWithEvents>(
                () =>
                    {

                        var dtex = new DteWithEvents(VsxHelper.GetDte(ServiceProvider));
                        dtex.SolutionEvents.AfterClosing += OnSolutionClosed;
                        VisualStudioTracer.Trace("subscribed to solution closed " + Thread.CurrentThread.ManagedThreadId, "ProjectScopeFactory");
                        return dtex;
                    });

            classificationsReference = new SynchInitializedInstance<GherkinFileEditorClassifications>(
                () => new GherkinFileEditorClassifications(ClassificationRegistry));

            projectScopeCache = new SynchronizedResultCache<Project, string, IProjectScope>(
                        project => new VsProjectScope(project, dteReference.Value, classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider, BindingSkeletonProviderFactory),
                        VsxHelper.GetProjectUniqueId);

            noProjectScopeReference = new SynchInitializedInstance<NoProjectScope>(() =>
                new NoProjectScope(classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider));
        }
        public ProjectScopeFactory()
        {
            dteReference = new SynchInitializedInstance<DteWithEvents>(
                () =>
                    {
                        ContainerProvider.ObjectContainer.Resolve<InstallServices>().OnPackageUsed(); //TODO: find a better place
                        var dtex = new DteWithEvents(VsxHelper.GetDte(ServiceProvider), VisualStudioTracer);
                        dtex.SolutionEvents.AfterClosing += OnSolutionClosed;
                        dtex.SolutionEventsListener.OnQueryUnloadProject += OnProjectClosed;
                        VisualStudioTracer.Trace("subscribed to solution closed " + Thread.CurrentThread.ManagedThreadId, "ProjectScopeFactory");
                        return dtex;
                    });

            classificationsReference = new SynchInitializedInstance<GherkinFileEditorClassifications>(
                () => new GherkinFileEditorClassifications(ClassificationRegistry));

            projectScopeCache = new SynchronizedResultCache<Project, string, IProjectScope>(
                        project => new VsProjectScope(project, dteReference.Value, classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider, ContainerProvider.ObjectContainer.Resolve<IObjectContainer>(), ContainerProvider.ObjectContainer.Resolve<RuntimeConfiguration>()),
                        VsxHelper.GetProjectUniqueId);

            noProjectScopeReference = new SynchInitializedInstance<NoProjectScope>(() =>
                new NoProjectScope(classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider));
        }
Example #4
0
        public ProjectScopeFactory()
        {
            dteReference = new SynchInitializedInstance <DteWithEvents>(
                () =>
            {
                ContainerProvider.ObjectContainer.Resolve <InstallServices>().OnPackageUsed();        //TODO: find a better place
                var dtex = new DteWithEvents(VsxHelper.GetDte(ServiceProvider), VisualStudioTracer);
                dtex.SolutionEvents.AfterClosing += OnSolutionClosed;
                dtex.SolutionEventsListener.OnQueryUnloadProject += OnProjectClosed;
                VisualStudioTracer.Trace("subscribed to solution closed " + Thread.CurrentThread.ManagedThreadId, "ProjectScopeFactory");
                return(dtex);
            });

            classificationsReference = new SynchInitializedInstance <GherkinFileEditorClassifications>(
                () => new GherkinFileEditorClassifications(ClassificationRegistry));

            projectScopeCache = new SynchronizedResultCache <Project, string, IProjectScope>(
                project => new VsProjectScope(project, dteReference.Value, classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider),
                VsxHelper.GetProjectUniqueId);

            noProjectScopeReference = new SynchInitializedInstance <NoProjectScope>(() =>
                                                                                    new NoProjectScope(classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider));
        }