本文整理汇总了C#中IMessageFactory.New方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageFactory.New方法的具体用法?C# IMessageFactory.New怎么用?C# IMessageFactory.New使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMessageFactory
的用法示例。
在下文中一共展示了IMessageFactory.New方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRooms
public static async Task<Message> GetRooms(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatServiceGetRoomsRequest)input;
var retVal = await ((IChatService)target).GetRooms();
var retMsg = msgFactory.New<IChatServiceGetRoomsReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例2: Login
public static async Task<Message> Login(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatLoginLoginRequest)input;
var retVal = await ((IChatLogin)target).Login(msg.name);
var retMsg = msgFactory.New<IChatLoginLoginReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例3: Complex
public static async Task<Message> Complex(IMessageFactory msgFactory, object target, Message input)
{
var msg = (ISomeServiceComplexRequest)input;
var retVal = await ((ISomeService)target).Complex(msg.requestId, msg.data, msg.name, msg.datas);
var retMsg = msgFactory.New<ISomeServiceComplexReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例4: Simple
public static async Task<Message> Simple(IMessageFactory msgFactory, object target, Message input)
{
var msg = (ISomeServiceSimpleRequest)input;
var retVal = await ((ISomeService)target).Simple(msg.requestId);
var retMsg = msgFactory.New<ISomeServiceSimpleReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例5: RemoveUser
public static async Task<Message> RemoveUser(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatRoomRemoveUserRequest)input;
var retVal = await ((IChatRoom)target).RemoveUser(msg.userId);
var retMsg = msgFactory.New<IChatRoomRemoveUserReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例6: GetUsersInside
public static async Task<Message> GetUsersInside(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatRoomGetUsersInsideRequest)input;
var retVal = await ((IChatRoom)target).GetUsersInside();
var retMsg = msgFactory.New<IChatRoomGetUsersInsideReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例7: TryRegisterUser
public static async Task<Message> TryRegisterUser(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IUserManagerTryRegisterUserRequest)input;
var retVal = await ((IUserManager)target).TryRegisterUser(msg.name);
var retMsg = msgFactory.New<IUserManagerTryRegisterUserReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例8: Join
public static async Task<Message> Join(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatRoomServiceJoinRequest)input;
var retVal = await ((IChatRoomService)target).Join(msg.ticket);
var retMsg = msgFactory.New<IChatRoomServiceJoinReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例9: JoinOrCreateRoom
public static async Task<Message> JoinOrCreateRoom(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatServiceJoinOrCreateRoomRequest)input;
var retVal = await ((IChatService)target).JoinOrCreateRoom(msg.roomName);
var retMsg = msgFactory.New<IChatServiceJoinOrCreateRoomReply>();
retMsg.RetVal = retVal;
return retMsg;
}