コード例 #1
0
 public static IServiceCollection AddPsesDebugServices(
     this IServiceCollection collection,
     IServiceProvider languageServiceProvider,
     PsesDebugServer psesDebugServer,
     bool useTempSession)
 {
     return(collection.AddSingleton(languageServiceProvider.GetService <PowerShellContextService>())
            .AddSingleton(languageServiceProvider.GetService <WorkspaceService>())
            .AddSingleton(languageServiceProvider.GetService <RemoteFileManagerService>())
            .AddSingleton <PsesDebugServer>(psesDebugServer)
            .AddSingleton <DebugService>()
            .AddSingleton <DebugStateService>(new DebugStateService
     {
         OwnsEditorSession = useTempSession
     })
            .AddSingleton <DebugEventHandlerService>());
 }
        public static IServiceCollection AddPsesDebugServices(
            this IServiceCollection collection,
            IServiceProvider languageServiceProvider,
            PsesDebugServer psesDebugServer)
        {
            PsesInternalHost internalHost = languageServiceProvider.GetService <PsesInternalHost>();

            return(collection
                   .AddSingleton(internalHost)
                   .AddSingleton <IRunspaceContext>(internalHost)
                   .AddSingleton <IPowerShellDebugContext>(internalHost.DebugContext)
                   .AddSingleton(languageServiceProvider.GetService <IInternalPowerShellExecutionService>())
                   .AddSingleton(languageServiceProvider.GetService <WorkspaceService>())
                   .AddSingleton(languageServiceProvider.GetService <RemoteFileManagerService>())
                   .AddSingleton(psesDebugServer)
                   .AddSingleton <DebugService>()
                   .AddSingleton <BreakpointService>()
                   .AddSingleton <DebugStateService>()
                   .AddSingleton <DebugEventHandlerService>());
        }