public RegistryKey GetStore() { try { using (var key = Registry.CurrentUser) { key.CreateSubKey(Path); } } catch (Exception ex) { _log.Error(ex, "Unable to create XenForms Windows registry key. User settings will not be used."); return(null); } try { var root = Registry.CurrentUser.OpenSubKey(Path, true); if (root == null) { _log.Error("XenForms registry key not found. User settings will not be used."); } return(root); } catch (Exception ex) { _log.Error(ex, "Unable to open XenForms registry key. User settings will not be used.."); return(null); } }
private void ShouldNotifyProjectFolderSet() { try { if (!string.IsNullOrWhiteSpace(ProjectFolder)) { _bus.Notify(new ProjectFolderSetEvent(ProjectFolder)); } } catch (Exception ex) { _log.Error(ex, $"Unable to send message {nameof(ProjectFolder)}."); } }