Esempio n. 1
0
        private void getStudyHistory()
        {
            Debug.WriteLine("getting study history");
            WebClient wc2 = new WebClient();

            wc2.OpenReadCompleted += (o2, e2) =>
            {
                Debug.WriteLine("reading study focus history complete");
                StreamReader studyFocusHistory = new StreamReader(e2.Result);
                while (!studyFocusHistory.EndOfStream)
                {
                    string currentWord = studyFocusHistory.ReadLine();
                    LeftSidebar.StudyFocusForeignWord.Items.Add(currentWord);
                }
                WebClient wc3 = new WebClient();
                wc3.OpenReadCompleted += (o3, e3) =>
                {
                    Debug.WriteLine("reading study focus complete");
                    StreamReader studyFocusReader = new StreamReader(e3.Result);
                    while (!studyFocusReader.EndOfStream)
                    {
                        tmpstudyfocus = studyFocusReader.ReadLine();
                        LeftSidebar.setStudyFocusNoChanges(tmpstudyfocus);
                        //LeftSidebar.StudyFocus = studyFocusReader.ReadLine();
                        break;
                    }
                    //LeftSidebar.focusWordChanged += serverCommunication.sendNewStudyFocus;
                    populateSentenceLists();
                };
                wc3.OpenReadAsync(new Uri(baseurl + "getStudyFocus.cgi.py?userName="******"getStudyHistory.cgi.py?userName=" + username));
        }
Esempio n. 2
0
        private void getDisplayedWords()
        {
            Debug.WriteLine("getting displayed words");
            WebClient wc5 = new WebClient();

            wc5.OpenReadCompleted += (o5, e5) =>
            {
                Debug.WriteLine("reading displayed words complete");
                StreamReader dispWords = new StreamReader(e5.Result);
                LeftSidebar.batchChanges = true;
                while (!dispWords.EndOfStream)
                {
                    string currentWord = dispWords.ReadLine();

                    LeftSidebar.allowWord(currentWord, false);
                    //System.Diagnostics.Debug.WriteLine(currentWord);
                }
                LeftSidebar.batchChanges = false;
                //LeftSidebar.updateDisplayedWords();
                getStudyHistory();
            };
            wc5.OpenReadAsync(new Uri(baseurl + "getDisplayedWords.aspx?userName=" + username));
        }