Пример #1
0
        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);
        }
Пример #2
0
 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);
     }
 }