/// <summary> /// Returns a <see cref="System.String" /> that represents this instance. /// </summary> /// <returns> /// A <see cref="System.String" /> that represents this instance. /// </returns> public override string ToString() { return(new StringBuilder() .AppendLine() .AppendLineFormat("Formatters: {0}", Formatters.ToString(x => x.Name)) .AppendFormat("Communicators: {0}", Communicators.ToString(x => x.Value.Name)) .ToString()); }
public void AddVoice(ICommunicator communicator) { if (Communicators.ContainsKey(communicator.Name)) { return; } Communicators.Add(communicator.Name, communicator); }
public void StopVoice(string name) { if (!Communicators.ContainsKey(name) || !Communicators[name].Active) { return; } Communicators[name].Stop(); Communicators[name].Active = false; }
public void StartVoice(string name) { if (!Communicators.ContainsKey(name) || Communicators[name].Active) { return; } Communicators[name].Listen(); Communicators[name].Active = true; }
public void AddMessageToOutgoing(IKalos message) { try { using (var streamWriter = File.AppendText("../tempChatLog.txt")) { streamWriter.WriteLine($"Sender: {message.Sender}|Origin:{message.Origin}|Timestamp:{message.Timestamp}|Message:{message.Msg}"); } } catch (Exception e) { } if (!Communicators.ContainsKey(message.Target)) { return; } Communicators[message.Target].AddMessage(message); }