示例#1
0
 public void  initialize(string messageBrokerHostName, uint port, string userName, string password, string topic)
 {
     synchronizationContext = System.Threading.SynchronizationContext.Current;
     settings           = new MqttSettings(messageBrokerHostName, port, true, userName, password, topic);
     Synthesizer        = new SpeechSynthesizer();
     Synthesizer.Volume = 100;
     try
     {
         Synthesizer.SelectVoice("Microsoft Szabolcs");
     }
     catch (ArgumentException)
     {
         //The choosen voice is not installed, we use the default.
     }
     ApplicationUserName = SessionViewModel.GetUsername();
     Client = new MqttClient(settings.MessageBrokerHostName, Convert.ToInt32(settings.Port), true, null, null, MqttSslProtocols.TLSv1_2);
     Client.MqttMsgPublishReceived += new MqttClient.MqttMsgPublishEventHandler(EventPublished);
 }
示例#2
0
 public Sentence()
 {
     Sender   = SessionViewModel.GetUsername();
     WordList = new List <string>();
 }