本文整理汇总了C#中Messages类的典型用法代码示例。如果您正苦于以下问题:C# Messages类的具体用法?C# Messages怎么用?C# Messages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Messages类属于命名空间,在下文中一共展示了Messages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sendMessage
public override void sendMessage(Messages.AbstractMessage message)
{
foreach (AbstractTransever trans in base.connections)
{
trans.sendMessage(message);
}
}
示例2: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
{
uint RoomId = Packet.PopWiredUInt();
string Password = Packet.PopFixedString();
Session.GetMessageHandler().PrepareRoomForUser(RoomId, Password);
}
示例3: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
{
Session.SendMessage(new UserObjectComposer(Session.GetHabbo()));
Session.SendMessage(new UserPerksComposer());
Session.GetHabbo().InitMessenger(); // Temporary fixxx
}
示例4: HandleChatMessage
private void HandleChatMessage(Messages.ChatMessage chatMessageMsg)
{
if (chatMessageMsg.From == _userName)
_serverActor.Tell(chatMessageMsg);
else
_consoleActor.Tell(new Messages.StatusMessage(chatMessageMsg.Message,StatusMessageType.Success));
}
示例5: InterceptResponse
public void InterceptResponse(ref Messages.InterDomainMessageResponse response)
{
RoutedInterDomainMessage ridm = (RoutedInterDomainMessage)response.Message;
lock (_postRequestors)
{
foreach (sRoute srt in ridm.PostInterceptRoutes)
{
if (_postRequestors.ContainsKey(srt))
{
foreach (IInterDomainMessagePostRequestInterceptor idmpri in _postRequestors[srt])
{
if (!response.HasIntercepted(idmpri.GetType()))
{
object tmp;
idmpri.InterceptResponse(response, out tmp);
if (tmp != null)
{
response = Messages.InterDomainMessageResponse.SwapResponse(response, tmp);
response.MarkInterceptor(idmpri.GetType());
}
}
}
}
}
}
}
示例6: subCallback
public void subCallback(Messages.std_msgs.String msg)
{
Dispatcher.Invoke(new Action(() =>
{
l.Content = "Receieved:\n" + msg.data;
}), new TimeSpan(0,0,1));
}
示例7: MessageSent
public void MessageSent(int chatId, int UsrId, Messages message)
{
if (_connections.IfExists(UsrId))
{
Clients.Client(_connections.GetConnection(UsrId)).NewChatCreated(message);
}
}
示例8: Resolve
public string Resolve(Messages.Field field)
{
var f = spec.Fields.Single(c => c.Name == field.Name);
var fixType = f.Type;
var clrType = typeMap[fixType];
var @enum = f.Values.Any();
if (@enum && clrType == "bool")
{
return clrType;
}
else if (@enum)
{
return field.Name;
}
else
{
var nullableMark = string.Empty;
if (field.Required == false && clrType != "string")
{
nullableMark = "?";
}
return string.Format("{0}{1}", clrType, nullableMark);
}
}
示例9: HandleChatMessage
private void HandleChatMessage(Messages.ChatMessage chatMessage)
{
foreach(var participant in _participants.Where(x=>x.Key != chatMessage.From))
{
participant.Value.Tell(chatMessage);
}
}
示例10: Post
public MessagesResponse Post(Messages request)
{
if (request.Message.Id > 0)
{
Bm2s.Data.Common.BLL.User.Message item = Datas.Instance.DataStorage.Messages[request.Message.Id];
item.Body = request.Message.Body;
item.IsShortMessage = request.Message.IsShortMessage;
item.SendDate = request.Message.SendDate;
item.Subject = request.Message.Subject;
item.UserId = request.Message.User.Id;
}
else
{
Bm2s.Data.Common.BLL.User.Message item = new Data.Common.BLL.User.Message()
{
Body = request.Message.Body,
IsShortMessage = request.Message.IsShortMessage,
SendDate = request.Message.SendDate,
Subject = request.Message.Subject,
UserId = request.Message.User.Id
};
Datas.Instance.DataStorage.Messages.Add(item);
request.Message.Id = item.Id;
}
MessagesResponse response = new MessagesResponse();
response.Messages.Add(request.Message);
return response;
}
示例11: Process
private static Response Process(string input, string[] args)
{
try
{
switch (args[0])
{
case "compile":
return Compiler.Compile(JsonConvert.DeserializeObject<CompileRequest>(input));
case "nunit":
return NUnitTester.Test(JsonConvert.DeserializeObject<TestRequest>(input));
case "nugetpack":
return NuGetter.Pack(JsonConvert.DeserializeObject<NuGetPackRequest>(input));
case "nugetpush":
return NuGetter.Push(JsonConvert.DeserializeObject<NuGetPushRequest>(input));
case "nugetrestore":
return NuGetter.Restore(JsonConvert.DeserializeObject<NuGetRestoreRequest>(input));
default:
throw new ApplicationException("Unsupported type '" + args[0] + "'");
}
}
catch (Exception e)
{
var messages = new Messages();
messages.Add(Message.CreateError(e.ToString()));
return new Response(messages);
}
}
示例12: HandleRegisterUser
private void HandleRegisterUser(Messages.RegisterUser x)
{
if(!string.IsNullOrEmpty(x.UserName))
{
registeredUsers.Add(x.UserName);
}
}
示例13: Parse
public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
{
Silverwave.HabboHotel.Users.Habbo targetHabbo = Session.GetHabbo();
if (targetHabbo == null)
{
return;
}
uint Id = Packet.PopWiredUInt();
RoomData Data = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);
if (Data == null || Session.GetHabbo().FavoriteRooms.Count >= 30 || Session.GetHabbo().FavoriteRooms.Contains(Id))
{
// send packet that favourites is full.
return;
}
Session.GetHabbo().FavoriteRooms.Add(Id);
Session.SendMessage(new UpdateFavouriteRoomComposer(Id, true));
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("INSERT INTO user_favorites (user_id,room_id) VALUES (" + Session.GetHabbo().Id + "," + Id + ")");
}
}
示例14: Messages
//
// GET: /account/messages/{accountName}/{number}
// GET: /account/messages/name={accountName}/{number}
// GET: /account/messages/id={accountId}/{number}
public ActionResult Messages(string accountName, Guid? accountId, int number)
{
Answer output;
try
{
if (accountId == null && accountName == null)
{
output = new Answer(new Error("Account missing"));
Response.StatusCode = 400; // Bad Request
}
else
{
var realId = accountId ?? Storage.Account.GetId(accountName);
// get lasts messages from account accoutName
var personalListId = Storage.List.GetPersonalList(realId);
var listMsgs = Storage.Msg.GetListsMsgTo(new HashSet<Guid> {personalListId}, DateTime.Now, number);
// convert, looking forward XML serialization
var listMsgsOutput = new Messages(listMsgs, Storage);
output = new Answer(listMsgsOutput);
}
}
catch (Exception exception)
{
// Result is an non-empty error XML element
output = new Answer(HandleError(exception));
}
return Serialize(output);
}
示例15: SearchReceivedEventArgs
internal SearchReceivedEventArgs(Messages.DiscoveryMessage message, System.Net.IPEndPoint sender)
{
ServiceType = message.Service.ServiceType;
MaxWaitTime = message.MaxWaitTime;
ReceivedContent = message.Content;
Sender = sender;
}