コード例 #1
0
        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());
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: ekblom/noterium
        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());
        }