Пример #1
0
 // Constructor that can be used by tests to pass in mock objects.
 internal SbDebuggerImpl(GrpcConnection connection, GrpcTargetFactory sbTargetFactory,
                         GrpcPlatformFactory sbPlatformFactory,
                         GrpcSbCommandInterpreterFactory sbCommandInterpreterFactory,
                         SbDebuggerRpcService.SbDebuggerRpcServiceClient client)
 {
     this.connection                  = connection;
     this.sbTargetFactory             = sbTargetFactory;
     this.sbPlatformFactory           = sbPlatformFactory;
     this.sbCommandInterpreterFactory = sbCommandInterpreterFactory;
     this.client = client;
 }
        internal SbCommandInterpreterImpl(
            GrpcConnection connection, SbCommandInterpreterRpcServiceClient client,
            GrpcSbCommandInterpreter grpcSbInterpreter,
            GrpcSbCommandInterpreterFactory commandInterpreterFactory,
            GrpcSbCommandReturnObjectFactory returnObjectFactory)
        {
            this.connection                = connection;
            this.client                    = client;
            this.grpcSbInterpreter         = grpcSbInterpreter;
            this.commandInterpreterFactory = commandInterpreterFactory;
            this.returnObjectFactory       = returnObjectFactory;

            // Keep a handle to objects we need in the destructor.
            gcHandle = GCHandle.Alloc(
                new Tuple <GrpcConnection,
                           SbCommandInterpreterRpcServiceClient,
                           GrpcSbCommandInterpreter>(
                    connection, client, grpcSbInterpreter));
        }