示例#1
0
        private static (VisualStudioWaitIndicator, Action cancel) CreateInstance(string title = "", string message = "", bool isCancelable = false)
        {
            var joinableTaskContext = new JoinableTaskContext();

            var(threadedWaitDialogFactory, cancel) = IVsThreadedWaitDialogFactoryFactory.Create(title, message, isCancelable);
            var threadedWaitDialogFactoryService = IVsUIServiceFactory.Create <SVsThreadedWaitDialogFactory, IVsThreadedWaitDialogFactory>(threadedWaitDialogFactory);

            var instance = new VisualStudioWaitIndicator(joinableTaskContext, threadedWaitDialogFactoryService);

            return(instance, cancel);
        }
        private static (VisualStudioWaitIndicator, Action cancel) CreateVisualStudioWaitIndicator(string title = "", string message = "", bool isCancelable = false)
        {
            var threadingService = IProjectThreadingServiceFactory.Create();

            var(threadedWaitDialogFactory, cancel) = IVsThreadedWaitDialogFactoryFactory.Create(title, message, isCancelable);
            var threadedWaitDialogFactoryService = IVsServiceFactory.Create <SVsThreadedWaitDialogFactory, IVsThreadedWaitDialogFactory>(threadedWaitDialogFactory);
            var unconfiguredProject = UnconfiguredProjectFactory.Create();

            var waitIndicator = new VisualStudioWaitIndicator(unconfiguredProject, threadingService, threadedWaitDialogFactoryService);

            return(waitIndicator, cancel);
        }