public void RegisterChannel(Strive.Network.Messages.CommunicationType communicationType, string name, MessageReceived callback) { if (!_registrations.Contains(CalculateChannelKey(communicationType, name))) { _registrations.Add(CalculateChannelKey(communicationType, name), callback); } }
public string CalculateChannelKey(Strive.Network.Messages.CommunicationType communicationType, string name) { string CalculateChannelKey_Return = communicationType.ToString(); if (communicationType == Strive.Network.Messages.CommunicationType.Tell) { CalculateChannelKey_Return = name + " - Private conversation"; } return(CalculateChannelKey_Return); }
public Chat(Strive.Network.Messages.CommunicationType communicationType, string characterName) { InitializeComponent(); this.Text = Game.CurrentMainWindow.CurrentChannelManager.CalculateChannelKey(communicationType, characterName); Game.CurrentMainWindow.CurrentChannelManager.RegisterChannel(communicationType, characterName, new Channels.ChannelManager.MessageReceived(ProcessCommunication)); }