private static void MapHubForDynamicType(this HubRouteBuilder builder, string route, Type type) { typeof(HubRouteBuilder) .GetMethod(nameof(HubRouteBuilder.MapHub), new Type[] { typeof(PathString) }) .MakeGenericMethod(type) .Invoke(builder, new Object[] { (PathString)route }); }
public static HubRouteBuilder MapSignalrRoutes(this HubRouteBuilder hubRouteBuilder) { IEnumerable <Assembly> assembliesPlugins = Directory.EnumerateFiles(AppDomain.CurrentDomain.BaseDirectory, "MachinaTrader.Plugin.*.dll", SearchOption.TopDirectoryOnly) .Select(Assembly.LoadFrom); foreach (var assembly in assembliesPlugins) { IEnumerable <Type> pluginHubTypes = assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(Hub)) && !t.IsAbstract); foreach (var pluginHubType in pluginHubTypes) { //Console.WriteLine("Assembly Name: " + assembly.GetName().Name); //Console.WriteLine("HubName: " + pluginHubType); string hubRoute = pluginHubType.ToString().Replace(assembly.GetName().Name, "").Replace(".Hubs.", "").Replace("MachinaTrader", ""); Global.Logger.Information(assembly.GetName().Name + " - Hub Route " + hubRoute); MapHubMethod.MakeGenericMethod(pluginHubType).Invoke(hubRouteBuilder, new object[] { new PathString("/signalr/" + hubRoute) }); } } //Add Global Hubs -> No plugin hubRouteBuilder.MapHub <HubMainIndex>("/signalr/HubMainIndex"); hubRouteBuilder.MapHub <HubTraders>("/signalr/HubTraders"); hubRouteBuilder.MapHub <HubStatistics>("/signalr/HubStatistics"); hubRouteBuilder.MapHub <HubBacktest>("/signalr/HubBacktest"); hubRouteBuilder.MapHub <HubExchangeAccounts>("/signalr/HubExchangeAccounts"); //Hub Log is located in Globals because we need to wire up with serilog hubRouteBuilder.MapHub <HubLogs>("/signalr/HubLogs"); return(hubRouteBuilder); }
public void MapHubs(HubRouteBuilder routes, string signalRUrlPrefix) { foreach (var map in Maps) { map.MapHub(routes, signalRUrlPrefix); } }
public static void CallMapHub(this HubRouteBuilder hubRouteBuilder, Type hubClassType, PathString pathString, Action <HttpConnectionDispatcherOptions> configureOptions = null) { Action <PathString, Action <HttpConnectionDispatcherOptions> > action = hubRouteBuilder.MapHub <Hub>; var mapHubMethodInfo = action.Method.GetGenericMethodDefinition().MakeGenericMethod(hubClassType); mapHubMethodInfo.Invoke(hubRouteBuilder, new object[] { pathString, configureOptions }); }
/// <summary> /// Maps Aika SignalR routes. /// </summary> /// <param name="hubRouteBuilder">The <see cref="HubRouteBuilder"/> to register the SignalR routes with.</param> /// <returns> /// The same <paramref name="hubRouteBuilder"/>, to allow method chaining. /// </returns> public static HubRouteBuilder MapAikaHubs(this HubRouteBuilder hubRouteBuilder) { if (hubRouteBuilder == null) { throw new ArgumentNullException(nameof(hubRouteBuilder)); } hubRouteBuilder.MapHub <Hubs.SnapshotHub>("aika/hubs/snapshot"); hubRouteBuilder.MapHub <Hubs.DataFilterHub>("aika/hubs/datafilter"); return(hubRouteBuilder); }
public static void MapTankaServerHub( this HubRouteBuilder routes, PathString route, Action <HttpConnectionDispatcherOptions> configureOptions = null) { if (configureOptions != null) { routes.MapHub <ServerHub>(route, configureOptions); } else { routes.MapHub <ServerHub>(route); } }
public static void MapHubs(this HubRouteBuilder builder, params Assembly[] assemblies) { if (null != builder && null != assemblies) { foreach (Assembly assembly in assemblies) { if (null != assembly) { foreach (Type type in assembly.GetTypes()) { if (!type.IsAbstract && HubType.IsAssignableFrom(type)) { MethodInfo generic = HubRouteBuilderMapHubMethod.MakeGenericMethod(type); generic.Invoke(builder, new object[] { new PathString("/hubs/" + type.Name.ToLower(UsCultureInfo).Replace("hub", "")) }); } } } } } }
public void MapHub(HubRouteBuilder routes, string hubPathPrefix) { routes.MapHub <ApiNotificationHub <AuthorDto> >(hubPathPrefix + "/blog/authors/notifications"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <FlightSearchHub>(signalRUrlPrefix + "/signalr/flight-search"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <MailingListDto> >(signalRUrlPrefix + "/cms/mailing-list/notifications"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <FaqDto> >(signalRUrlPrefix + "/cms/faqs/notifications"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <ContentTextDto> >(signalRUrlPrefix + "/cms/content-texts/notifications"); }
public static HubRouteBuilder MapDotNetifyHub(this HubRouteBuilder routes) { routes.MapHub <DotNetifyHub>("dotnetify"); return(routes); }
public static HubRouteBuilder MapDotNetifyHub(this HubRouteBuilder routes) { routes.MapHub <DotNetifyHub>(HUB_PATH); return(routes); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <CarouselItemDto> >(signalRUrlPrefix + "/cms/carousel-items/notifications"); }
protected virtual void ConfigureSignalRHubs(HubRouteBuilder routes) { }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <FormDto> >(signalRUrlPrefix + "/forms/form-section-submissions/notifications"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <LookupTableDto> >(signalRUrlPrefix + "/forms/lookup-tables/notifications"); }
public static void MapQueryHub(this HubRouteBuilder routes, string path = "/hubs/query") => routes.MapHub <QueryHub>(path);
public static void MapQueryHub(this HubRouteBuilder routes, Action <HttpConnectionDispatcherOptions> configure, string path = "/hubs/query") => routes.MapHub <QueryHub>(path, configure);
public static void ConfigureSignalRUsage(HubRouteBuilder routeBuilder) { routeBuilder.MapHub <CourseChangeHub>("/courseChange"); }
private void ConfigureHubRouteBuilder(HubRouteBuilder hubRouteBuilder) { hubRouteBuilder.MapHub <SignalRHub>("/enigma-signalr-hub"); }
internal void ConfigureSignalRRoutes(HubRouteBuilder signalRRoutes) => _signalRRoutes?.Invoke(signalRRoutes);
public static void MapHubs(this HubRouteBuilder routeBuilder) { routeBuilder.MapHub <AuthenticationNotificationHub>(SignalREndpoints.AuthenticationNotificationHubName); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <BlogPostDto> >(signalRUrlPrefix + "/blog/blog-posts/notifications"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <QuestionDto> >(signalRUrlPrefix + "/forms/questions/notifications"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <TestimonialDto> >(signalRUrlPrefix + "/cms/testimonials/notifications"); }
public static HubRouteBuilder MapDotNetifyHub(this HubRouteBuilder routes, Action <HttpConnectionDispatcherOptions> options) { routes.MapHub <DotNetifyHub>(HUB_PATH, options); return(routes); }
public static void Register(HubRouteBuilder route) { route.MapHub <PaymentRequestHub>("/payment-requests/hub"); }
public void MapHub(HubRouteBuilder routes, string signalRUrlPrefix) { routes.MapHub <ApiNotificationHub <TagDto> >(signalRUrlPrefix + "/blog/tags/notifications"); }