private async void OnEnviromentDocumentSaved(object sender, DevEnviromentDocument e) { var documentExtension = Path.GetExtension(e.Path); try { if (_supportedResourceExtensions.Contains(documentExtension.ToLowerInvariant())) { await _clientsHolder.UpdateResourceAsync(e.Path, e.Content); } } catch (AggregateException) { _logger.Log($"{TextResources.Update_Failed_Message} {TextResources.Device_Offline_Message}"); } }
private async void OnEnviromentDocumentSaved(object sender, DevEnviromentDocument e) { var documentExtension = Path.GetExtension(e.Path)?.ToLowerInvariant(); try { if (_supportedResourceExtensions.Contains(documentExtension)) { if (string.IsNullOrWhiteSpace(e.Content) && File.Exists(e.Path)) { e.Content = File.ReadAllText(e.Path); } await _clientsHolder.UpdateResourceAsync(e.Path, e.Content); } } catch (AggregateException) { _logger.Log($"{TextResources.Update_Failed_Message} {TextResources.Device_Offline_Message}"); } catch { _logger.Log($"{TextResources.Update_Failed_Message} {TextResources.Unknown_Error}"); } }