public async Task <IeeeXploreSearchQuery> GetSearchQueryIeeeXplore(string query, CancellationTokenSource cts = null) { string webPageSource = null; string webPageSource2 = null; try { string url = String.Format(_resources["SearchQueryIeeeXplore"].ToString(), query); webPageSource = await GetWebPageSource(url, cts); webPageSource2 = webPageSource.ToString(); return(XmlSerialize <IeeeXploreSearchQuery> .DeserializeXml(webPageSource)); } catch (TaskCanceledException) { throw; } catch (Exception) { if (webPageSource != null && !webPageSource.Equals(webPageSource2)) { Messenger.Default.Send(new ExceptionToSettingsMessage { Exception = ViewModelLocator.Instance.Settings, Source = "IEEE Xplore", }); } else { throw; } return(null); } }
public async Task <IeeeXploreSearchQuery> GetPreviousOrNextResultIeeeXplore(string query, int start, CancellationTokenSource cts = null) { try { string url = String.Format(_resources["IeeeXplorePreviousOrNextPageResult"].ToString(), query, start); string webPageSource = await GetWebPageSource(url, cts); return(XmlSerialize <IeeeXploreSearchQuery> .DeserializeXml(webPageSource)); } catch (TaskCanceledException) { throw; } catch (Exception) { return(null); } }
private AnalyzerDatabaseSettings EmptySettings() { AnalyzerDatabaseSettings settings = new AnalyzerDatabaseSettings(); XmlSerialize <AnalyzerDatabaseSettings> .InitEmptyProperties(settings); settings.ScienceDirectAndScopusApiKey = ""; settings.SpringerApiKey = ""; settings.StartOnLogin = true; settings.SavingPublicationPath = LocalizationSettingsService.DefaultSavingLocalizationPublicationsPath; if (!ZetaLongPaths.ZlpIOHelper.DirectoryExists(LocalizationSettingsService.ProgramDataApplicationDirectory)) { ZetaLongPaths.ZlpIOHelper.CreateDirectory(LocalizationSettingsService.ProgramDataApplicationDirectory); } XmlSerialize <AnalyzerDatabaseSettings> .Serialize(settings, LocalizationSettingsService.AnalyzerDatabaseConfigPath); return(settings); }
private AnalyzerDatabaseStatistics LoadStatistics() { try { AnalyzerDatabaseStatistics statistics; if (ZetaLongPaths.ZlpIOHelper.FileExists(LocalizationStatisticsService.AnalyzerDatabaseStatisticsPath)) { statistics = XmlSerialize <AnalyzerDatabaseStatistics> .Deserialize( LocalizationStatisticsService.AnalyzerDatabaseStatisticsPath); } else { statistics = EmptyStatistics(); } return(statistics); } catch (Exception) { return(EmptyStatistics()); } }
private AnalyzerDatabaseSettings LoadSettings() { try { AnalyzerDatabaseSettings settings; if (ZetaLongPaths.ZlpIOHelper.FileExists(LocalizationSettingsService.AnalyzerDatabaseConfigPath)) { settings = XmlSerialize <AnalyzerDatabaseSettings> .Deserialize( LocalizationSettingsService.AnalyzerDatabaseConfigPath); } else { settings = EmptySettings(); } return(settings); } catch (Exception) { return(EmptySettings()); } }
private AnalyzerDatabaseStatistics EmptyStatistics() { AnalyzerDatabaseStatistics statistics = new AnalyzerDatabaseStatistics(); XmlSerialize <AnalyzerDatabaseStatistics> .InitEmptyProperties(statistics); statistics.ScienceDirectCount = 0; statistics.ScopusCount = 0; statistics.SpringerCount = 0; statistics.IeeeXploreCount = 0; statistics.DuplicateCount = 0; statistics.PublicationsDownloadCount = 0; statistics.SumCount = 0; if (!ZetaLongPaths.ZlpIOHelper.DirectoryExists(LocalizationStatisticsService.ProgramDataApplicationDirectory)) { ZetaLongPaths.ZlpIOHelper.CreateDirectory(LocalizationStatisticsService.ProgramDataApplicationDirectory); } XmlSerialize <AnalyzerDatabaseStatistics> .Serialize(statistics, LocalizationStatisticsService.AnalyzerDatabaseStatisticsPath); return(statistics); }
public void SaveStatistics() { XmlSerialize <AnalyzerDatabaseStatistics> .Serialize(_analyzerDatabaseStatistics, LocalizationStatisticsService.AnalyzerDatabaseStatisticsPath); }
public void Save() { XmlSerialize <AnalyzerDatabaseSettings> .Serialize(Settings, LocalizationSettingsService.AnalyzerDatabaseConfigPath); }