Ejemplo n.º 1
0
 public static EndpointHandler Create <TRequest, TResponse>(IPredicateHandler languagePredicateHandler, CompositionHost host,
                                                            ILogger logger, EndpointDescriptor item,
                                                            IEnumerable <Lazy <IRequestHandler, OmniSharpLanguage> > handlers,
                                                            Lazy <EndpointHandler <UpdateBufferRequest, object> > updateBufferHandler,
                                                            IEnumerable <Plugin> plugins)
 {
     return(new EndpointHandler <TRequest, TResponse>(languagePredicateHandler, host, logger, item, handlers.Where(x => x.Metadata.EndpointName == item.EndpointName), updateBufferHandler, plugins));
 }
Ejemplo n.º 2
0
 public static LanguageProtocolInteropHandler Create <TRequest, TResponse>(
     IPredicateHandler languagePredicateHandler,
     OmniSharpEndpointMetadata metadata,
     IEnumerable <Lazy <IRequestHandler, OmniSharpRequestHandlerMetadata> > handlers,
     Lazy <LanguageProtocolInteropHandler <UpdateBufferRequest, object> > updateBufferHandler)
 {
     return(new LanguageProtocolInteropHandler <TRequest, TResponse>(languagePredicateHandler, metadata, handlers.Where(x => x.Metadata.EndpointName == metadata.EndpointName), updateBufferHandler));
 }
Ejemplo n.º 3
0
        public static EndpointHandler Factory(IPredicateHandler languagePredicateHandler, CompositionHost host,
                                              ILogger logger, EndpointDescriptor item,
                                              IEnumerable <Lazy <IRequestHandler, OmniSharpLanguage> > handlers,
                                              Lazy <EndpointHandler <UpdateBufferRequest, object> > updateBufferHandler,
                                              IEnumerable <Plugin> plugins)
        {
            var createMethod = typeof(EndpointHandler).GetTypeInfo().DeclaredMethods.First(x => x.Name == nameof(EndpointHandler.Create));

            return((EndpointHandler)createMethod.MakeGenericMethod(item.RequestType, item.ResponseType).Invoke(null, new object[] { languagePredicateHandler, host, logger, item, handlers, updateBufferHandler, plugins }));
        }
Ejemplo n.º 4
0
        public static LanguageProtocolInteropHandler Factory(
            IPredicateHandler languagePredicateHandler,
            OmniSharpEndpointMetadata metadata,
            IEnumerable <Lazy <IRequestHandler, OmniSharpRequestHandlerMetadata> > handlers,
            Lazy <LanguageProtocolInteropHandler <UpdateBufferRequest, object> > updateBufferHandler)
        {
            var createMethod = typeof(LanguageProtocolInteropHandler).GetTypeInfo().DeclaredMethods.First(x => x.Name == nameof(LanguageProtocolInteropHandler.Create));

            return((LanguageProtocolInteropHandler)createMethod.MakeGenericMethod(metadata.RequestType, metadata.ResponseType).Invoke(null, new object[] { languagePredicateHandler, metadata, handlers, updateBufferHandler }));
        }