Example #1
0
 // Creates a DebugPortSupplier with specific factories.  Used by tests.
 public DebugPortSupplier(DebugPort.Factory debugPortFactory,
                          GameletClient.Factory gameletClientFactory,
                          IExtensionOptions options, IDialogUtil dialogUtil,
                          CancelableTask.Factory cancelableTaskFactory, IMetrics metrics,
                          ICloudRunner cloudRunner, string developerAccount)
 {
     _debugPortFactory      = debugPortFactory;
     _gameletClientFactory  = gameletClientFactory;
     _dialogUtil            = dialogUtil;
     _cancelableTaskFactory = cancelableTaskFactory;
     _metrics          = metrics;
     _cloudRunner      = cloudRunner;
     _developerAccount = developerAccount;
 }
Example #2
0
        // Creates a DebugPortSupplier.  This will be invoked by Visual Studio based on this class
        // Guid being in the registry.
        public DebugPortSupplier()
        {
            // Factory creation for the PortSupplier entry point.
            var serviceManager        = new ServiceManager();
            IExtensionOptions options =
                ((YetiVSIService)serviceManager.RequireGlobalService(typeof(YetiVSIService)))
                .Options;
            var taskContext               = serviceManager.GetJoinableTaskContext();
            var debugPropertyFactory      = new DebugProperty.Factory();
            var debugProgramFactory       = new DebugProgram.Factory(debugPropertyFactory, options);
            var debugProcessFactory       = new DebugProcess.Factory(debugProgramFactory);
            var managedProcessFactory     = new ManagedProcess.Factory();
            var processListRequestFactory = new ProcessListRequest.Factory(managedProcessFactory);
            var jsonUtil                = new JsonUtil();
            var sdkConfigFactory        = new SdkConfig.Factory(jsonUtil);
            var credentialConfigFactory = new CredentialConfig.Factory(jsonUtil);
            var accountOptionLoader     = new VsiAccountOptionLoader(options);
            var credentialManager       =
                new CredentialManager(credentialConfigFactory, accountOptionLoader);

            _developerAccount = credentialManager.LoadAccount();
            _dialogUtil       = new DialogUtil();
            var progressDialogFactory = new ProgressDialog.Factory();

            _cancelableTaskFactory = new CancelableTask.Factory(taskContext, progressDialogFactory);
            var cloudConnection = new CloudConnection();

            // NOTE: this CloudRunner is re-used for all subsequent Attach to Process windows.
            _cloudRunner = new CloudRunner(sdkConfigFactory, credentialManager, cloudConnection,
                                           new GgpSDKUtil());
            var sshKeyLoader        = new SshKeyLoader(managedProcessFactory);
            var sshKnownHostsWriter = new SshKnownHostsWriter();

            _gameletClientFactory = new GameletClient.Factory();
            var sshManager =
                new SshManager(_gameletClientFactory, _cloudRunner, sshKeyLoader,
                               sshKnownHostsWriter, new RemoteCommand(managedProcessFactory));

            _metrics          = (IMetrics)serviceManager.RequireGlobalService(typeof(SMetrics));
            _debugPortFactory = new DebugPort.Factory(
                debugProcessFactory, processListRequestFactory, _cancelableTaskFactory, _dialogUtil,
                sshManager, _metrics, _developerAccount);
        }