// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; namespace Microsoft.AspNetCore.SignalR { /// /// Extension methods for . /// public static class HubClientsExtensions { /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connection. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1) { return hubClients.AllExcept(new [] { excludedConnectionId1 }); } /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// The second connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1, string excludedConnectionId2) { return hubClients.AllExcept(new [] { excludedConnectionId1, excludedConnectionId2 }); } /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3) { return hubClients.AllExcept(new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3 }); } /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4) { return hubClients.AllExcept(new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4 }); } /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5) { return hubClients.AllExcept(new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5 }); } /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// The sixth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5, string excludedConnectionId6) { return hubClients.AllExcept(new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5, excludedConnectionId6 }); } /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// The sixth connection to exclude. /// The seventh connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5, string excludedConnectionId6, string excludedConnectionId7) { return hubClients.AllExcept(new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5, excludedConnectionId6, excludedConnectionId7 }); } /// /// Gets a that can be used to invoke methods on all clients connected to the hub excluding the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// The sixth connection to exclude. /// The seventh connection to exclude. /// The eighth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T AllExcept(this IHubClients hubClients, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5, string excludedConnectionId6, string excludedConnectionId7, string excludedConnectionId8) { return hubClients.AllExcept(new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5, excludedConnectionId6, excludedConnectionId7, excludedConnectionId8 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1) { return hubClients.Clients(new [] { connection1 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// The second connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1, string connection2) { return hubClients.Clients(new [] { connection1, connection2 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// The second connection to include. /// The third connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1, string connection2, string connection3) { return hubClients.Clients(new [] { connection1, connection2, connection3 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// The second connection to include. /// The third connection to include. /// The fourth connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1, string connection2, string connection3, string connection4) { return hubClients.Clients(new [] { connection1, connection2, connection3, connection4 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// The second connection to include. /// The third connection to include. /// The fourth connection to include. /// The fifth connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1, string connection2, string connection3, string connection4, string connection5) { return hubClients.Clients(new [] { connection1, connection2, connection3, connection4, connection5 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// The second connection to include. /// The third connection to include. /// The fourth connection to include. /// The fifth connection to include. /// The sixth connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1, string connection2, string connection3, string connection4, string connection5, string connection6) { return hubClients.Clients(new [] { connection1, connection2, connection3, connection4, connection5, connection6 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// The second connection to include. /// The third connection to include. /// The fourth connection to include. /// The fifth connection to include. /// The sixth connection to include. /// The seventh connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1, string connection2, string connection3, string connection4, string connection5, string connection6, string connection7) { return hubClients.Clients(new [] { connection1, connection2, connection3, connection4, connection5, connection6, connection7 }); } /// /// Gets a that can be used to invoke methods on the specified connections. /// /// The abstraction that provides access to connections. /// The first connection to include. /// The second connection to include. /// The third connection to include. /// The fourth connection to include. /// The fifth connection to include. /// The sixth connection to include. /// The seventh connection to include. /// The eighth connection to include. /// A representing the methods that can be invoked on the clients. public static T Clients(this IHubClients hubClients, string connection1, string connection2, string connection3, string connection4, string connection5, string connection6, string connection7, string connection8) { return hubClients.Clients(new [] { connection1, connection2, connection3, connection4, connection5, connection6, connection7, connection8 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1) { return hubClients.Groups(new [] { group1 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// The second group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1, string group2) { return hubClients.Groups(new [] { group1, group2 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// The second group to include. /// The third group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1, string group2, string group3) { return hubClients.Groups(new [] { group1, group2, group3 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// The second group to include. /// The third group to include. /// The fourth group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1, string group2, string group3, string group4) { return hubClients.Groups(new [] { group1, group2, group3, group4 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// The second group to include. /// The third group to include. /// The fourth group to include. /// The fifth group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1, string group2, string group3, string group4, string group5) { return hubClients.Groups(new [] { group1, group2, group3, group4, group5 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// The second group to include. /// The third group to include. /// The fourth group to include. /// The fifth group to include. /// The sixth group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1, string group2, string group3, string group4, string group5, string group6) { return hubClients.Groups(new [] { group1, group2, group3, group4, group5, group6 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// The second group to include. /// The third group to include. /// The fourth group to include. /// The fifth group to include. /// The sixth group to include. /// The seventh group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1, string group2, string group3, string group4, string group5, string group6, string group7) { return hubClients.Groups(new [] { group1, group2, group3, group4, group5, group6, group7 }); } /// /// Gets a that can be used to invoke methods on all connections in all of the specified groups. /// /// The abstraction that provides access to connections. /// The first group to include. /// The second group to include. /// The third group to include. /// The fourth group to include. /// The fifth group to include. /// The sixth group to include. /// The seventh group to include. /// The eighth group to include. /// A representing the methods that can be invoked on the clients. public static T Groups(this IHubClients hubClients, string group1, string group2, string group3, string group4, string group5, string group6, string group7, string group8) { return hubClients.Groups(new [] { group1, group2, group3, group4, group5, group6, group7, group8 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// The second connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1, string excludedConnectionId2) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1, excludedConnectionId2 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// The sixth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5, string excludedConnectionId6) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5, excludedConnectionId6 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// The sixth connection to exclude. /// The seventh connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5, string excludedConnectionId6, string excludedConnectionId7) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5, excludedConnectionId6, excludedConnectionId7 }); } /// /// Gets a that can be used to invoke methods on all connections in the specified group excluding the specified connections. /// /// The abstraction that provides access to connections. /// The group name. /// The first connection to exclude. /// The second connection to exclude. /// The third connection to exclude. /// The fourth connection to exclude. /// The fifth connection to exclude. /// The sixth connection to exclude. /// The seventh connection to exclude. /// The eighth connection to exclude. /// A representing the methods that can be invoked on the clients. public static T GroupExcept(this IHubClients hubClients, string groupName, string excludedConnectionId1, string excludedConnectionId2, string excludedConnectionId3, string excludedConnectionId4, string excludedConnectionId5, string excludedConnectionId6, string excludedConnectionId7, string excludedConnectionId8) { return hubClients.GroupExcept(groupName, new [] { excludedConnectionId1, excludedConnectionId2, excludedConnectionId3, excludedConnectionId4, excludedConnectionId5, excludedConnectionId6, excludedConnectionId7, excludedConnectionId8 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1) { return hubClients.Users(new [] { user1 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// The second user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1, string user2) { return hubClients.Users(new [] { user1, user2 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// The second user to include. /// The third user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1, string user2, string user3) { return hubClients.Users(new [] { user1, user2, user3 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// The second user to include. /// The third user to include. /// The fourth user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1, string user2, string user3, string user4) { return hubClients.Users(new [] { user1, user2, user3, user4 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// The second user to include. /// The third user to include. /// The fourth user to include. /// The fifth user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1, string user2, string user3, string user4, string user5) { return hubClients.Users(new [] { user1, user2, user3, user4, user5 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// The second user to include. /// The third user to include. /// The fourth user to include. /// The fifth user to include. /// The sixth user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1, string user2, string user3, string user4, string user5, string user6) { return hubClients.Users(new [] { user1, user2, user3, user4, user5, user6 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// The second user to include. /// The third user to include. /// The fourth user to include. /// The fifth user to include. /// The sixth user to include. /// The seventh user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1, string user2, string user3, string user4, string user5, string user6, string user7) { return hubClients.Users(new [] { user1, user2, user3, user4, user5, user6, user7 }); } /// /// Gets a that can be used to invoke methods on all connections associated with all of the specified users. /// /// The abstraction that provides access to connections. /// The first user to include. /// The second user to include. /// The third user to include. /// The fourth user to include. /// The fifth user to include. /// The sixth user to include. /// The seventh user to include. /// The eighth user to include. /// A representing the methods that can be invoked on the clients. public static T Users(this IHubClients hubClients, string user1, string user2, string user3, string user4, string user5, string user6, string user7, string user8) { return hubClients.Users(new [] { user1, user2, user3, user4, user5, user6, user7, user8 }); } } }