Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

7 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
6 лет назад
6 лет назад
6 лет назад
6 лет назад
6 лет назад
6 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
7 лет назад
6 лет назад
7 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. using System;
  2. using System.Collections.Concurrent;
  3. using System.Collections.ObjectModel;
  4. using System.IO;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Windows.Security.Cryptography.Certificates;
  8. using Windows.UI.Core;
  9. using Windows.UI.Xaml;
  10. using MQTTnet.Client;
  11. using MQTTnet.Diagnostics;
  12. using MQTTnet.Exceptions;
  13. using MQTTnet.Extensions.ManagedClient;
  14. using MQTTnet.Extensions.Rpc;
  15. using MQTTnet.Implementations;
  16. using MQTTnet.Protocol;
  17. using MQTTnet.Server;
  18. using MqttClientConnectedEventArgs = MQTTnet.Client.MqttClientConnectedEventArgs;
  19. using MqttClientDisconnectedEventArgs = MQTTnet.Client.MqttClientDisconnectedEventArgs;
  20. namespace MQTTnet.TestApp.UniversalWindows
  21. {
  22. public sealed partial class MainPage
  23. {
  24. private readonly ConcurrentQueue<MqttNetLogMessage> _traceMessages = new ConcurrentQueue<MqttNetLogMessage>();
  25. private readonly ObservableCollection<IMqttClientSessionStatus> _sessions = new ObservableCollection<IMqttClientSessionStatus>();
  26. private IMqttClient _mqttClient;
  27. private IManagedMqttClient _managedMqttClient;
  28. private IMqttServer _mqttServer;
  29. public MainPage()
  30. {
  31. InitializeComponent();
  32. ClientId.Text = Guid.NewGuid().ToString("D");
  33. MqttNetGlobalLogger.LogMessagePublished += OnTraceMessagePublished;
  34. }
  35. private async void OnTraceMessagePublished(object sender, MqttNetLogMessagePublishedEventArgs e)
  36. {
  37. _traceMessages.Enqueue(e.TraceMessage);
  38. await UpdateLogAsync();
  39. }
  40. private async Task UpdateLogAsync()
  41. {
  42. while (_traceMessages.Count > 100)
  43. {
  44. _traceMessages.TryDequeue(out _);
  45. }
  46. var logText = new StringBuilder();
  47. foreach (var traceMessage in _traceMessages)
  48. {
  49. logText.AppendFormat(
  50. "[{0:yyyy-MM-dd HH:mm:ss.fff}] [{1}] [{2}] [{3}] [{4}]{5}",
  51. traceMessage.Timestamp,
  52. traceMessage.Level,
  53. traceMessage.Source,
  54. traceMessage.ThreadId,
  55. traceMessage.Message,
  56. Environment.NewLine);
  57. if (traceMessage.Exception != null)
  58. {
  59. logText.AppendLine(traceMessage.Exception.ToString());
  60. }
  61. }
  62. await Trace.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
  63. {
  64. Trace.Text = logText.ToString();
  65. });
  66. }
  67. private async void Connect(object sender, RoutedEventArgs e)
  68. {
  69. var tlsOptions = new MqttClientTlsOptions
  70. {
  71. UseTls = UseTls.IsChecked == true,
  72. IgnoreCertificateChainErrors = true,
  73. IgnoreCertificateRevocationErrors = true,
  74. AllowUntrustedCertificates = true
  75. };
  76. var options = new MqttClientOptions
  77. {
  78. ClientId = ClientId.Text
  79. };
  80. if (UseTcp.IsChecked == true)
  81. {
  82. options.ChannelOptions = new MqttClientTcpOptions
  83. {
  84. Server = Server.Text,
  85. Port = int.Parse(Port.Text),
  86. TlsOptions = tlsOptions
  87. };
  88. }
  89. if (UseWs.IsChecked == true)
  90. {
  91. options.ChannelOptions = new MqttClientWebSocketOptions
  92. {
  93. Uri = Server.Text,
  94. TlsOptions = tlsOptions
  95. };
  96. }
  97. if (options.ChannelOptions == null)
  98. {
  99. throw new InvalidOperationException();
  100. }
  101. options.Credentials = new MqttClientCredentials
  102. {
  103. Username = User.Text,
  104. Password = Password.Text
  105. };
  106. options.CleanSession = CleanSession.IsChecked == true;
  107. options.KeepAlivePeriod = TimeSpan.FromSeconds(double.Parse(KeepAliveInterval.Text));
  108. try
  109. {
  110. if (_mqttClient != null)
  111. {
  112. await _mqttClient.DisconnectAsync();
  113. _mqttClient.ApplicationMessageReceived -= OnApplicationMessageReceived;
  114. _mqttClient.Connected -= OnConnected;
  115. _mqttClient.Disconnected -= OnDisconnected;
  116. }
  117. var factory = new MqttFactory();
  118. if (UseManagedClient.IsChecked == true)
  119. {
  120. _managedMqttClient = factory.CreateManagedMqttClient();
  121. _managedMqttClient.ApplicationMessageReceived += OnApplicationMessageReceived;
  122. _managedMqttClient.Connected += OnConnected;
  123. _managedMqttClient.Disconnected += OnDisconnected;
  124. await _managedMqttClient.StartAsync(new ManagedMqttClientOptions
  125. {
  126. ClientOptions = options
  127. });
  128. }
  129. else
  130. {
  131. _mqttClient = factory.CreateMqttClient();
  132. _mqttClient.ApplicationMessageReceived += OnApplicationMessageReceived;
  133. _mqttClient.Connected += OnConnected;
  134. _mqttClient.Disconnected += OnDisconnected;
  135. await _mqttClient.ConnectAsync(options);
  136. }
  137. }
  138. catch (Exception exception)
  139. {
  140. Trace.Text += exception + Environment.NewLine;
  141. }
  142. }
  143. private void OnDisconnected(object sender, MqttClientDisconnectedEventArgs e)
  144. {
  145. _traceMessages.Enqueue(new MqttNetLogMessage("", DateTime.Now, -1,
  146. "", MqttNetLogLevel.Info, "! DISCONNECTED EVENT FIRED", null));
  147. Task.Run(UpdateLogAsync);
  148. }
  149. private void OnConnected(object sender, MqttClientConnectedEventArgs e)
  150. {
  151. _traceMessages.Enqueue(new MqttNetLogMessage("", DateTime.Now, -1,
  152. "", MqttNetLogLevel.Info, "! CONNECTED EVENT FIRED", null));
  153. Task.Run(UpdateLogAsync);
  154. }
  155. private async void OnApplicationMessageReceived(object sender, MqttApplicationMessageReceivedEventArgs eventArgs)
  156. {
  157. var item = $"Timestamp: {DateTime.Now:O} | Topic: {eventArgs.ApplicationMessage.Topic} | Payload: {Encoding.UTF8.GetString(eventArgs.ApplicationMessage.Payload)} | QoS: {eventArgs.ApplicationMessage.QualityOfServiceLevel}";
  158. await Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
  159. {
  160. if (AddReceivedMessagesToList.IsChecked == true)
  161. {
  162. ReceivedMessages.Items.Add(item);
  163. }
  164. });
  165. }
  166. private async void Publish(object sender, RoutedEventArgs e)
  167. {
  168. try
  169. {
  170. var qos = MqttQualityOfServiceLevel.AtMostOnce;
  171. if (QoS1.IsChecked == true)
  172. {
  173. qos = MqttQualityOfServiceLevel.AtLeastOnce;
  174. }
  175. if (QoS2.IsChecked == true)
  176. {
  177. qos = MqttQualityOfServiceLevel.ExactlyOnce;
  178. }
  179. var payload = new byte[0];
  180. if (PlainText.IsChecked == true)
  181. {
  182. payload = Encoding.UTF8.GetBytes(Payload.Text);
  183. }
  184. if (Base64.IsChecked == true)
  185. {
  186. payload = Convert.FromBase64String(Payload.Text);
  187. }
  188. var message = new MqttApplicationMessageBuilder()
  189. .WithTopic(Topic.Text)
  190. .WithPayload(payload)
  191. .WithQualityOfServiceLevel(qos)
  192. .WithRetainFlag(Retain.IsChecked == true)
  193. .Build();
  194. if (_mqttClient != null)
  195. {
  196. await _mqttClient.PublishAsync(message);
  197. }
  198. if (_managedMqttClient != null)
  199. {
  200. await _managedMqttClient.PublishAsync(message);
  201. }
  202. }
  203. catch (Exception exception)
  204. {
  205. Trace.Text += exception + Environment.NewLine;
  206. }
  207. }
  208. private async void Disconnect(object sender, RoutedEventArgs e)
  209. {
  210. try
  211. {
  212. if (_mqttClient != null)
  213. {
  214. await _mqttClient.DisconnectAsync();
  215. _mqttClient.Dispose();
  216. _mqttClient = null;
  217. }
  218. if (_managedMqttClient != null)
  219. {
  220. await _managedMqttClient.StopAsync();
  221. _managedMqttClient.Dispose();
  222. _managedMqttClient = null;
  223. }
  224. }
  225. catch (Exception exception)
  226. {
  227. Trace.Text += exception + Environment.NewLine;
  228. }
  229. }
  230. private void ClearLog(object sender, RoutedEventArgs e)
  231. {
  232. while (_traceMessages.Count > 0)
  233. {
  234. _traceMessages.TryDequeue(out _);
  235. }
  236. Trace.Text = string.Empty;
  237. }
  238. private async void Subscribe(object sender, RoutedEventArgs e)
  239. {
  240. try
  241. {
  242. var qos = MqttQualityOfServiceLevel.AtMostOnce;
  243. if (SubscribeQoS1.IsChecked == true)
  244. {
  245. qos = MqttQualityOfServiceLevel.AtLeastOnce;
  246. }
  247. if (SubscribeQoS2.IsChecked == true)
  248. {
  249. qos = MqttQualityOfServiceLevel.ExactlyOnce;
  250. }
  251. if (_mqttClient != null)
  252. {
  253. await _mqttClient.SubscribeAsync(new TopicFilter(SubscribeTopic.Text, qos));
  254. }
  255. if (_managedMqttClient != null)
  256. {
  257. await _managedMqttClient.SubscribeAsync(new TopicFilter(SubscribeTopic.Text, qos));
  258. }
  259. }
  260. catch (Exception exception)
  261. {
  262. Trace.Text += exception + Environment.NewLine;
  263. }
  264. }
  265. private async void Unsubscribe(object sender, RoutedEventArgs e)
  266. {
  267. try
  268. {
  269. if (_mqttClient != null)
  270. {
  271. await _mqttClient.UnsubscribeAsync(SubscribeTopic.Text);
  272. }
  273. if (_managedMqttClient != null)
  274. {
  275. await _managedMqttClient.UnsubscribeAsync(SubscribeTopic.Text);
  276. }
  277. }
  278. catch (Exception exception)
  279. {
  280. Trace.Text += exception + Environment.NewLine;
  281. }
  282. }
  283. // This code is for the Wiki at GitHub!
  284. // ReSharper disable once UnusedMember.Local
  285. private async void StartServer(object sender, RoutedEventArgs e)
  286. {
  287. if (_mqttServer != null)
  288. {
  289. return;
  290. }
  291. JsonServerStorage storage = null;
  292. if (ServerPersistRetainedMessages.IsChecked == true)
  293. {
  294. storage = new JsonServerStorage();
  295. if (ServerClearRetainedMessages.IsChecked == true)
  296. {
  297. storage.Clear();
  298. }
  299. }
  300. _mqttServer = new MqttFactory().CreateMqttServer();
  301. var options = new MqttServerOptions();
  302. options.DefaultEndpointOptions.Port = int.Parse(ServerPort.Text);
  303. options.Storage = storage;
  304. options.EnablePersistentSessions = ServerAllowPersistentSessions.IsChecked == true;
  305. await _mqttServer.StartAsync(options);
  306. }
  307. private async void StopServer(object sender, RoutedEventArgs e)
  308. {
  309. if (_mqttServer == null)
  310. {
  311. return;
  312. }
  313. await _mqttServer.StopAsync();
  314. _mqttServer = null;
  315. }
  316. private void ClearReceivedMessages(object sender, RoutedEventArgs e)
  317. {
  318. ReceivedMessages.Items.Clear();
  319. }
  320. private async void ExecuteRpc(object sender, RoutedEventArgs e)
  321. {
  322. var qos = MqttQualityOfServiceLevel.AtMostOnce;
  323. if (RpcQoS1.IsChecked == true)
  324. {
  325. qos = MqttQualityOfServiceLevel.AtLeastOnce;
  326. }
  327. if (RpcQoS2.IsChecked == true)
  328. {
  329. qos = MqttQualityOfServiceLevel.ExactlyOnce;
  330. }
  331. var payload = new byte[0];
  332. if (RpcText.IsChecked == true)
  333. {
  334. payload = Encoding.UTF8.GetBytes(RpcPayload.Text);
  335. }
  336. if (RpcBase64.IsChecked == true)
  337. {
  338. payload = Convert.FromBase64String(RpcPayload.Text);
  339. }
  340. try
  341. {
  342. var rpcClient = new MqttRpcClient(_mqttClient);
  343. var response = await rpcClient.ExecuteAsync(TimeSpan.FromSeconds(5), RpcMethod.Text, payload, qos);
  344. RpcResponses.Items.Add(RpcMethod.Text + " >>> " + Encoding.UTF8.GetString(response));
  345. }
  346. catch (MqttCommunicationTimedOutException)
  347. {
  348. RpcResponses.Items.Add(RpcMethod.Text + " >>> [TIMEOUT]");
  349. }
  350. catch (Exception exception)
  351. {
  352. RpcResponses.Items.Add(RpcMethod.Text + " >>> [EXCEPTION (" + exception.Message + ")]");
  353. }
  354. }
  355. private void ClearRpcResponses(object sender, RoutedEventArgs e)
  356. {
  357. RpcResponses.Items.Clear();
  358. }
  359. private void ClearSessions(object sender, RoutedEventArgs e)
  360. {
  361. _sessions.Clear();
  362. }
  363. private async void RefreshSessions(object sender, RoutedEventArgs e)
  364. {
  365. if (_mqttServer == null)
  366. {
  367. return;
  368. }
  369. var sessions = await _mqttServer.GetClientSessionsStatusAsync();
  370. _sessions.Clear();
  371. foreach (var session in sessions)
  372. {
  373. _sessions.Add(session);
  374. }
  375. ListViewSessions.DataContext = _sessions;
  376. }
  377. #region Wiki Code
  378. private async Task WikiCode()
  379. {
  380. {
  381. // Write all trace messages to the console window.
  382. MqttNetGlobalLogger.LogMessagePublished += (s, e) =>
  383. {
  384. Console.WriteLine($">> [{e.TraceMessage.Timestamp:O}] [{e.TraceMessage.ThreadId}] [{e.TraceMessage.Source}] [{e.TraceMessage.Level}]: {e.TraceMessage.Message}");
  385. if (e.TraceMessage.Exception != null)
  386. {
  387. Console.WriteLine(e.TraceMessage.Exception);
  388. }
  389. };
  390. }
  391. {
  392. // Use a custom identifier for the trace messages.
  393. var clientOptions = new MqttClientOptionsBuilder()
  394. .Build();
  395. }
  396. {
  397. // Create a new MQTT client.
  398. var factory = new MqttFactory();
  399. var mqttClient = factory.CreateMqttClient();
  400. {
  401. // Create TCP based options using the builder.
  402. var options = new MqttClientOptionsBuilder()
  403. .WithClientId("Client1")
  404. .WithTcpServer("broker.hivemq.com")
  405. .WithCredentials("bud", "%spencer%")
  406. .WithTls()
  407. .WithCleanSession()
  408. .Build();
  409. await mqttClient.ConnectAsync(options);
  410. }
  411. {
  412. // Use TCP connection.
  413. var options = new MqttClientOptionsBuilder()
  414. .WithTcpServer("broker.hivemq.com", 1883) // Port is optional
  415. .Build();
  416. }
  417. {
  418. // Use secure TCP connection.
  419. var options = new MqttClientOptionsBuilder()
  420. .WithTcpServer("broker.hivemq.com")
  421. .WithTls()
  422. .Build();
  423. }
  424. {
  425. // Use WebSocket connection.
  426. var options = new MqttClientOptionsBuilder()
  427. .WithWebSocketServer("broker.hivemq.com:8000/mqtt")
  428. .Build();
  429. await mqttClient.ConnectAsync(options);
  430. }
  431. {
  432. // Create TCP based options manually
  433. var options = new MqttClientOptions
  434. {
  435. ClientId = "Client1",
  436. Credentials = new MqttClientCredentials
  437. {
  438. Username = "bud",
  439. Password = "%spencer%"
  440. },
  441. ChannelOptions = new MqttClientTcpOptions
  442. {
  443. Server = "broker.hivemq.org",
  444. TlsOptions = new MqttClientTlsOptions
  445. {
  446. UseTls = true
  447. }
  448. },
  449. };
  450. }
  451. {
  452. // Subscribe to a topic
  453. await mqttClient.SubscribeAsync(new TopicFilterBuilder().WithTopic("my/topic").Build());
  454. // Unsubscribe from a topic
  455. await mqttClient.UnsubscribeAsync("my/topic");
  456. // Publish an application message
  457. var applicationMessage = new MqttApplicationMessageBuilder()
  458. .WithTopic("A/B/C")
  459. .WithPayload("Hello World")
  460. .WithAtLeastOnceQoS()
  461. .Build();
  462. await mqttClient.PublishAsync(applicationMessage);
  463. }
  464. }
  465. // ----------------------------------
  466. {
  467. var options = new MqttServerOptions();
  468. options.ConnectionValidator = c =>
  469. {
  470. if (c.ClientId.Length < 10)
  471. {
  472. c.ReturnCode = MqttConnectReturnCode.ConnectionRefusedIdentifierRejected;
  473. return;
  474. }
  475. if (c.Username != "mySecretUser")
  476. {
  477. c.ReturnCode = MqttConnectReturnCode.ConnectionRefusedBadUsernameOrPassword;
  478. return;
  479. }
  480. if (c.Password != "mySecretPassword")
  481. {
  482. c.ReturnCode = MqttConnectReturnCode.ConnectionRefusedBadUsernameOrPassword;
  483. return;
  484. }
  485. c.ReturnCode = MqttConnectReturnCode.ConnectionAccepted;
  486. };
  487. var factory = new MqttFactory();
  488. var mqttServer = factory.CreateMqttServer();
  489. await mqttServer.StartAsync(options);
  490. Console.WriteLine("Press any key to exit.");
  491. Console.ReadLine();
  492. await mqttServer.StopAsync();
  493. }
  494. // ----------------------------------
  495. // For UWP apps:
  496. MqttTcpChannel.CustomIgnorableServerCertificateErrorsResolver = o =>
  497. {
  498. if (o.Server == "server_with_revoked_cert")
  499. {
  500. return new[] { ChainValidationResult.Revoked };
  501. }
  502. return new ChainValidationResult[0];
  503. };
  504. {
  505. // Start a MQTT server.
  506. var mqttServer = new MqttFactory().CreateMqttServer();
  507. await mqttServer.StartAsync(new MqttServerOptions());
  508. Console.WriteLine("Press any key to exit.");
  509. Console.ReadLine();
  510. await mqttServer.StopAsync();
  511. }
  512. {
  513. // Configure MQTT server.
  514. var optionsBuilder = new MqttServerOptionsBuilder()
  515. .WithConnectionBacklog(100)
  516. .WithDefaultEndpointPort(1884);
  517. var options = new MqttServerOptions
  518. {
  519. };
  520. options.ConnectionValidator = c =>
  521. {
  522. if (c.ClientId != "Highlander")
  523. {
  524. c.ReturnCode = MqttConnectReturnCode.ConnectionRefusedIdentifierRejected;
  525. return;
  526. }
  527. c.ReturnCode = MqttConnectReturnCode.ConnectionAccepted;
  528. };
  529. var mqttServer = new MqttFactory().CreateMqttServer();
  530. await mqttServer.StartAsync(optionsBuilder.Build());
  531. }
  532. {
  533. // Setup client validator.
  534. var options = new MqttServerOptions
  535. {
  536. ConnectionValidator = c =>
  537. {
  538. if (c.ClientId.Length < 10)
  539. {
  540. c.ReturnCode = MqttConnectReturnCode.ConnectionRefusedIdentifierRejected;
  541. return;
  542. }
  543. if (c.Username != "mySecretUser")
  544. {
  545. c.ReturnCode = MqttConnectReturnCode.ConnectionRefusedBadUsernameOrPassword;
  546. return;
  547. }
  548. if (c.Password != "mySecretPassword")
  549. {
  550. c.ReturnCode = MqttConnectReturnCode.ConnectionRefusedBadUsernameOrPassword;
  551. return;
  552. }
  553. c.ReturnCode = MqttConnectReturnCode.ConnectionAccepted;
  554. }
  555. };
  556. }
  557. {
  558. // Create a new MQTT server.
  559. var mqttServer = new MqttFactory().CreateMqttServer();
  560. }
  561. {
  562. // Setup and start a managed MQTT client.
  563. var options = new ManagedMqttClientOptionsBuilder()
  564. .WithAutoReconnectDelay(TimeSpan.FromSeconds(5))
  565. .WithClientOptions(new MqttClientOptionsBuilder()
  566. .WithClientId("Client1")
  567. .WithTcpServer("broker.hivemq.com")
  568. .WithTls().Build())
  569. .Build();
  570. var mqttClient = new MqttFactory().CreateManagedMqttClient();
  571. await mqttClient.SubscribeAsync(new TopicFilterBuilder().WithTopic("my/topic").Build());
  572. await mqttClient.StartAsync(options);
  573. }
  574. }
  575. #endregion
  576. }
  577. }