Esempio n. 1
0
 /// <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());
 }
Esempio n. 2
0
        public void AddVoice(ICommunicator communicator)
        {
            if (Communicators.ContainsKey(communicator.Name))
            {
                return;
            }

            Communicators.Add(communicator.Name, communicator);
        }
Esempio n. 3
0
        public void StopVoice(string name)
        {
            if (!Communicators.ContainsKey(name) || !Communicators[name].Active)
            {
                return;
            }

            Communicators[name].Stop();
            Communicators[name].Active = false;
        }
Esempio n. 4
0
        public void StartVoice(string name)
        {
            if (!Communicators.ContainsKey(name) || Communicators[name].Active)
            {
                return;
            }

            Communicators[name].Listen();
            Communicators[name].Active = true;
        }
Esempio n. 5
0
 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);
 }