protected override Boolean trySignIn() { XmlDocument signedInXmlDocument; ouSignedInWebSession = OuSignedInWebSession.signIn(username, password, out signedInXmlDocument); signedInXmlDocument.preserve("SignedIn.xml"); if (null == ouSignedInWebSession) { Console.Error.WriteLine("Error: could not sign-in student: {0}", username); return(false); } return(true); }
public void download() { try { #if USE_MOCK_DOWNLOADER downloadAllNotDownloadedWith(new SleepyMockDownloader(MockDownloadData.load()), ProgramSettings.downloadsDirectoryPath); #else OuSignedInWebSession ouSignedInWebSession = OuSignInForm.signIn(this); if (null == ouSignedInWebSession) { return; } using (ouSignedInWebSession) { downloadAllNotDownloadedWith(new OuDownloader(ouSignedInWebSession), ProgramSettings.downloadsDirectoryPath); } #endif } catch (Exception exception) { this.error(exception); } }