Fix credential generation.

This commit is contained in:
Christian Kratky
2019-04-24 20:19:55 +02:00
parent 0cac2aa1bc
commit 9da3377aa7
@@ -119,12 +119,15 @@ namespace MQTTnet.TestApp.UniversalWindows
throw new InvalidOperationException(); throw new InvalidOperationException();
} }
options.Credentials = new MqttClientCredentials if (!string.IsNullOrEmpty(User.Text))
{ {
Username = User.Text, options.Credentials = new MqttClientCredentials
Password = Password.Text {
}; Username = User.Text,
Password = Password.Text
};
}
options.CleanSession = CleanSession.IsChecked == true; options.CleanSession = CleanSession.IsChecked == true;
options.KeepAlivePeriod = TimeSpan.FromSeconds(double.Parse(KeepAliveInterval.Text)); options.KeepAlivePeriod = TimeSpan.FromSeconds(double.Parse(KeepAliveInterval.Text));