public void Receive(string name, byte[] message, object custom) { var logItem = new MessageLogItem(DateTime.UtcNow, name, message, custom); MessageHistory.Add(logItem); if (!MessageBindAccess.AnyBind(name)) { if (ThrowNoneBinds) { throw new MessageNotBindedException("Received not binded message: " + name, name, message); } else { return; } } var binds = MessageBindAccess.GetBinds(name); for (int i = 0; i < binds.Count; i++) { binds[i].BindAction(custom); } }
private void CommandList(params string[] _) { foreach (Command cmd in Commands) { MessageHistory.Add(new Message(cmd.Keyword + " " + GetArgsInfo(cmd) + " (" + cmd.Description + ")", Color.GreenYellow)); } }
public void AddToHistory(UserMessage newMessage, bool SaveChange = true) { MessageHistory.Add(newMessage); if (SaveChange) { SaveChanges(); } }
public override void NotifyConversationUsers(string message) { MessageHistory.Add(message); foreach (var attendee in Attendees) { attendee.Notify(Id, "New Notification!! " + message); } }
private void SetFOV(params string[] args) { bool success = Int32.TryParse(args[0], out int fov); if (!success) { MessageHistory.Add(new Message("Invalid argument: " + args[0], new Color(1.0f, 0, 0))); return; } _game.Camera.FieldOfView = fov; }
public void Receive(string name, byte[] message, object custom) { var logItem = new MessageLogItem(DateTime.UtcNow, name, message, custom); MessageHistory.Add(logItem); if (!MessageBindAccess.AnyBind(name)) { throw new MessageNotBindedException("Received not binded message: " + name, name, message); } var binds = MessageBindAccess.GetBinds(name); for (int i = 0; i < binds.Count; i++) { var messageDeserialized = SerializationProvider.Deserialize(binds[i].MessageType, message); logItem.AddMessage(messageDeserialized); binds[i].BindAction(messageDeserialized); } }
public void ArchiveMessages() { MessageHistory.Add(TodaysMessages); TodaysMessages = new List <Message>(); }