private static Library GetLibrary() { Library library = null; if (!Hub.Instance.AppSettings.Librarys.Any()) { StorageSelector selector = new StorageSelector(); selector.ShowDialog(); } else { library = Hub.Instance.AppSettings.Librarys.FirstOrDefault(l => l.Name.Equals(Hub.Instance.AppSettings.SelectedLibrary)); } return(library ?? Hub.Instance.AppSettings.Librarys.FirstOrDefault()); }
private static Library GetLibrary(string libraryName) { Library library = null; if (!Hub.Instance.AppSettings.Librarys.Any()) { var selector = new StorageSelector(); selector.ShowDialog(); } else { var libName = libraryName ?? Hub.Instance.AppSettings.DefaultLibrary ?? string.Empty; library = Hub.Instance.AppSettings.Librarys.FirstOrDefault(l => l.Name.Equals(libName)); } return(library ?? Hub.Instance.AppSettings.Librarys.FirstOrDefault()); }