コード例 #1
0
 internal RazorRemoteHostClient(
     ServiceHubRemoteHostClient client,
     RazorServiceDescriptorsWrapper serviceDescriptors,
     RazorRemoteServiceCallbackDispatcherRegistry callbackDispatchers
     )
 {
     _client              = client;
     _serviceDescriptors  = serviceDescriptors;
     _callbackDispatchers = callbackDispatchers;
 }
コード例 #2
0
        public static async Task <RazorRemoteHostClient?> TryGetClientAsync(
            HostWorkspaceServices services,
            RazorServiceDescriptorsWrapper serviceDescriptors,
            RazorRemoteServiceCallbackDispatcherRegistry callbackDispatchers,
            CancellationToken cancellationToken = default
            )
        {
            var client = await RemoteHostClient
                         .TryGetClientAsync(services, cancellationToken)
                         .ConfigureAwait(false);

            if (client is null)
            {
                return(null);
            }

            return(new RazorRemoteHostClient(
                       (ServiceHubRemoteHostClient)client,
                       serviceDescriptors,
                       callbackDispatchers
                       ));
        }