protected virtual IHqSourceManager GetLibrary(string url, out List <Hq> library, out List <string> lethers, double timeCache) { lock (_lockThis5) { CoreEventHub.OnProcessingStart(this, new ProcessingEventArgs(DateTime.Now)); var lib = new LibraryPage(); var lt = new List <string>(); lib = _cacheManager.CacheManagement(url, _hqSource.GetLibrary, timeCache); if (lib != null) { NextPage = lib.NextPage; FinalizedPage = lib.FinalizedPage; if (lib.Letras != null && lib.Letras.Count > 0) { Lethers = lib.Letras; foreach (var kv in Lethers) { lt.Add(kv.Key); } } lethers = lt; library = lib.Hqs; } else { lethers = new List <string>(); library = new List <Hq>(); } CoreEventHub.OnProcessingEnd(this, new ProcessingEventArgs(DateTime.Now)); GC.Collect(); GC.WaitForPendingFinalizers(); return(this); } }
public void OnScrollChanged(object sender, ScrollChangedEventArgs e) { if (e.VerticalChange != 0) { var scrollViewer = (ScrollViewer)e.OriginalSource; if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight) { Task.Run(() => { Dispatcher.Invoke(() => { _notification.Visibility = true; }); var library = new LibraryPage(); _actualSource = _actualSource.NextLibraryPage(out library); Dispatcher.Invoke(() => { foreach (var hq in library.Hqs) { _sourceLibraries.HqLibrary.Add(hq); } _notification.Visibility = false; }); }); } } }
private ObservableCollection <Hq> GetHqsFromLibrary(LibraryOperation method) { var library = new LibraryPage(); method.Invoke(out library); return(new ObservableCollection <Hq>(library.Hqs)); }
public virtual IHqSourceManager GetLetherPage(string lether, out LibraryPage library, double timeCache) { library = new LibraryPage(); if (Lethers.ContainsKey(lether)) { GetLibrary(Lethers[lether], out library, timeCache); } return(this); }
public void SetUp() { driver = new ChromeDriver(); loginPage = new LoginPage(driver); homePage = new HomePage(driver); libraryPage = new LibraryPage(driver); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://www.wattpad.com/"); loginPage.NavigateToLoginPage(); loginPage.LoginApplication(loginCredentials.Username, loginCredentials.Password); }
protected virtual IHqSourceManager GetLibrary(string url, out LibraryPage library, double timeCache) { lock (_lockThis) { library = new LibraryPage(); library = _cacheManager.CacheManagement(url, _hqSource.GetLibrary, timeCache); NextPage = library.NextPage; FinalizedPage = library.FinalizedPage; if (library.Letras != null && library.Letras.Count > 0) { Lethers = library.Letras; } return(this); } }
public void ShowLibraryWithLether(string lether) { Task.Run(() => { Dispatcher.Invoke(() => { _notification.Visibility = true; }); var library = new LibraryPage(); _actualSource = _actualSource.GetLetherPage(lether, out library); Dispatcher.Invoke(() => { _sourceLibraries.HqLibrary = new ObservableCollection <Hq>(library.Hqs);; _notification.Visibility = false; }); }); }
public virtual IHqSourceManager NextLibraryPage(out LibraryPage library, double timeCache) => GetLibrary(NextPage, out library, timeCache);
public virtual IHqSourceManager GetFinalizedPage(out LibraryPage library, double timeCache) => GetLibrary(FinalizedPage, out library, timeCache);
public static string GetUrl(LibraryPage page) { switch (page) { case LibraryPage.Home: return("~/"); case LibraryPage.NotAuthorized: return("~/NotAuthorized.aspx"); case LibraryPage.Login: return("~/Login.aspx"); case LibraryPage.Authors: return("~/Pages/Authors/List.aspx"); case LibraryPage.AddAuthor: return("~/Pages/Authors/Add.aspx"); case LibraryPage.EditAuthor: return("~/Pages/Authors/Edit.aspx"); case LibraryPage.Books: return("~/Pages/Books/List.aspx"); case LibraryPage.AddBook: return("~/Pages/Books/Add.aspx"); case LibraryPage.EditBook: return("~/Pages/Books/Edit.aspx"); case LibraryPage.BookCopies: return("~/Pages/Books/Copies.aspx"); case LibraryPage.Libraries: return("~/Pages/Libraries/List.aspx"); case LibraryPage.AddLibrary: return("~/Pages/Libraries/Add.aspx"); case LibraryPage.EditLibrary: return("~/Pages/Libraries/Edit.aspx"); case LibraryPage.Librarians: return("~/Pages/Librarians/List.aspx"); case LibraryPage.AddLibrarian: return("~/Pages/Librarians/Add.aspx"); case LibraryPage.EditLibrarian: return("~/Pages/Librarians/Edit.aspx"); case LibraryPage.Patrons: return("~/Pages/Patrons/List.aspx"); case LibraryPage.AddPatron: return("~/Pages/Patrons/Add.aspx"); case LibraryPage.EditPatron: return("~/Pages/Patrons/Edit.aspx"); case LibraryPage.AccountSettings: // Placeholder return("~/Pages/Account/ChangePassword.aspx"); default: return("~/"); } }