Click or drag to resize

PushMessengerTMessenger Class


The general proxy class that exposes methods for pushing message from server to client. Derived classes are client-server communication combinations, that are to be used for a specific purpose
Inheritance Hierarchy
SystemObject
  Ingeniux.CMS.Models.MessagingPushMessengerTMessenger

Namespace:  Ingeniux.CMS.Models.Messaging
Assembly:  Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.5.94
Syntax
public class PushMessenger<TMessenger> : IPushMessenger
where TMessenger : MessengerBase

Type Parameters

TMessenger
Type of proxy for client to send message to server

The PushMessengerTMessenger type exposes the following members.

Constructors
Properties
  NameDescription
Public propertySiteName
Gets the name of the Site
Public propertyUserId
Gets the user ID of the User that will be sending out the push message
Public propertyUserName
Gets the name of the User that will be sending out the push message
Top
Methods
  NameDescription
Public methodGetHubContext
Retrieves SignalR Hub context, for the underlying messenger type
Public methodSendToAll(String)
Sends a string message to every logged-in user at client side
Public methodSendToAllT(T)
Sends a message containing an object to every logged-in user at client side
Public methodSendToGroups(String, IUserGroup)
Sends a string message to client side, only the CMS clients with login user as member of the specified user groups, will receive this message
Public methodSendToGroupsT(T, IUserGroup)
Sends a message containing an object to client side, only the CMS clients with login user as member of the specified user groups, will receive this message
Public methodSendToMe(String)
Sends a string message to client side, only the CMS clients with login of Current User will receive this message
Public methodSendToMeT(T)
Sends a message containing an object to client side, only the CMS clients with login of Current User will receive this message
Public methodSendToUser(String, String)
Sends a string message to client side, only the CMS clients with login of specified user will receive this message
Public methodSendToUserT(T, String)
Sends a message containing an object to client side, only the CMS clients with login of specified users will receive this message
Public methodSendToUsers(String, String)
Sends a string message to client side, only the CMS clients with login of specified users will receive this message
Public methodSendToUsersT(T, String)
Sends a message containing an object to client side, only the CMS clients with login of specified users will receive this message
Top
Examples

Following example is a messenger specifically to communicate publishing information. Client side can receive messages from this messenger by creating a function called "pubStatus" to listen to the message

C#
public class PublishingMessenger : MessengerBase
{
}

public class PublishingPushMessenger : PushMessenger<PublishingMessenger>
{
    public PublishingPushMessenger(IContentStore store, IReadonlyUser user)
        : base(store, user)
    {
    }
    public PublishingPushMessenger(IUserSession session)
        : base(session)
    {
    }

    public void SignlarPublishing(PublishStatusMessage status)
    {
        GetHubContext().Clients.All.PubStatus(status);
    }
}
See Also