예제 #1
0
 public void NewDay()
 {
     rnd = new Random();
     NewWordToEnter = new NewWordTemplate();
     Logs.Write("programm started");
     CreateNewDuration(); //говнокод
     UpdateStatistic();
     CreateDayStatItem(); //статистика по текущему дню
     StartWork();
     SelectedTabIndex = 1;
 }
예제 #2
0
 public MyWord(NewWordTemplate tmp)
 {
     parentWordEntity = ViewModel.generalEntity.Data.Create();
     ViewModel.generalEntity.Data.Add(parentWordEntity);
     this.Word = tmp.Word;
     this.Translate = tmp.Translate;
     this.Example = tmp.Example;
     Complexity = 2;
     RandomNumber = 1;
     IsRightAnswer = true;
     IsChanged = false;
     IsEasy = false;
     IsAnswered = false;
 }
예제 #3
0
        private ObservableCollection<NewWordTemplate> GetWordsFromClipboard()
        {
            string clipboardData = Clipboard.GetText();
            ObservableCollection<NewWordTemplate> results = new ObservableCollection<NewWordTemplate>();
            string[] listString = clipboardData.Split(new string[] { "\r\n" }, StringSplitOptions.None);
            foreach (string oneline in listString) {
                string[] wordMembers = oneline.Split(new string[] { "\t" }, StringSplitOptions.None);
                if (wordMembers.Count() == 3) {
                    string word = wordMembers[0];
                    string translate = wordMembers[1];
                    string example = wordMembers[2];

                    NewWordTemplate wrdTemplate = new NewWordTemplate();
                    wrdTemplate.Word = word;
                    wrdTemplate.Translate = translate;
                    wrdTemplate.Example = example;

                    results.Add(wrdTemplate);
                }
            }
            return results;
        }
예제 #4
0
 void EnterNewWord()
 {
     MyWord wrd = new MyWord(NewWordToEnter);
     ListAllWords.Add(wrd);
     ListWordsForWork.Add(wrd);
     CurrentWordForAllWordsGrid = wrd;
     NewWordToEnter = new NewWordTemplate();
 }