public EventHookupTestState(XElement workspaceElement, IDictionary <OptionKey, object> options)
            : base(workspaceElement, excludedTypes: null, GetExtraParts(), false)
        {
            _commandHandler = new EventHookupCommandHandler(Workspace.GetService <IInlineRenameService>(),
                                                            Workspace.ExportProvider.GetExportedValue <IAsynchronousOperationListenerProvider>(),
                                                            Workspace.ExportProvider.GetExportedValue <EventHookupSessionManager>());

            _testSessionHookupMutex = new Mutex(false);
            _commandHandler.TESTSessionHookupMutex = _testSessionHookupMutex;
            Workspace.ApplyOptions(options);
        }
示例#2
0
        public EventHookupTestState(XElement workspaceElement, IDictionary <OptionKey, object> options)
            : base(workspaceElement, excludedTypes: null, GetExtraParts(), false)
        {
#pragma warning disable CS0618 // IQuickInfo* is obsolete, tracked by https://github.com/dotnet/roslyn/issues/24094
            _commandHandler = new EventHookupCommandHandler(Workspace.GetService <IInlineRenameService>(), Workspace.GetService <IQuickInfoBroker>(),
                                                            prematureDismissalPreventer: null, Workspace.ExportProvider.GetExportedValue <IAsynchronousOperationListenerProvider>());
#pragma warning restore CS0618 // IQuickInfo* is obsolete, tracked by https://github.com/dotnet/roslyn/issues/24094

            _testSessionHookupMutex = new Mutex(false);
            _commandHandler.TESTSessionHookupMutex = _testSessionHookupMutex;
            Workspace.ApplyOptions(options);
        }
示例#3
0
        public EventHookupTestState(XElement workspaceElement, IDictionary <OptionKey, object> options)
            : base(workspaceElement, null, false)
        {
            CommandHandlerService t = (CommandHandlerService)Workspace.GetService <ICommandHandlerServiceFactory>().GetService(Workspace.Documents.Single().TextBuffer);
            var field    = t.GetType().GetField("_commandHandlers", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
            var handlers = (IEnumerable <Lazy <ICommandHandler, OrderableContentTypeMetadata> >)field.GetValue(t);

            _commandHandler = handlers.Single(h => h.Value is EventHookupCommandHandler).Value as EventHookupCommandHandler;

            _testSessionHookupMutex = new Mutex(false);
            _commandHandler.TESTSessionHookupMutex = _testSessionHookupMutex;
            Workspace.ApplyOptions(options);
        }
        public EventHookupTestState(XElement workspaceElement, OptionsCollection options)
            : base(workspaceElement, GetExtraParts())
        {
            _commandHandler = new EventHookupCommandHandler(
                Workspace.ExportProvider.GetExportedValue <IThreadingContext>(),
                Workspace.GetService <IInlineRenameService>(),
                Workspace.ExportProvider.GetExportedValue <IAsynchronousOperationListenerProvider>(),
                Workspace.ExportProvider.GetExportedValue <EventHookupSessionManager>());

            _testSessionHookupMutex = new Mutex(false);
            _commandHandler.TESTSessionHookupMutex = _testSessionHookupMutex;
            Workspace.ApplyOptions(options);
        }