Пример #1
0
        private void LoadSelectedList()
        {
            FormLoadList loadList = new FormLoadList();

            if (loadList.ShowDialog() == DialogResult.OK)
            {
                dataGridViewEdit.Columns.Clear();
                dataGridViewEdit.Rows.Clear();

                string selection = loadList.SelectedList;

                foreach (string language in WinFormsHelper.Languages(selection))
                {
                    dataGridViewEdit.Columns.Add(language, language.ToUpper());
                }

                foreach (string[] words in WinFormsHelper.AllWords(selection))
                {
                    dataGridViewEdit.Rows.Add(words);
                }

                EditButtonsSwitch();
                buttonAddWord.Enabled = true;

                labelCurrentWordList.Text = $"Current list: {loadList.SelectedList}";

                CurrentList = loadList.SelectedList;
            }
        }
Пример #2
0
        public void RefreshLoadedList()
        {
            dataGridViewEdit.Columns.Clear();
            dataGridViewEdit.Rows.Clear();

            foreach (string language in WinFormsHelper.Languages(CurrentList))
            {
                dataGridViewEdit.Columns.Add(language, language.ToUpper());
            }

            foreach (string[] words in WinFormsHelper.AllWords(CurrentList))
            {
                dataGridViewEdit.Rows.Add(words);
            }
        }
Пример #3
0
        public void LoadNewList(FormNewList newList)
        {
            dataGridViewEdit.Columns.Clear();
            dataGridViewEdit.Rows.Clear();

            string selection = newList.SelectedList;

            foreach (string language in WinFormsHelper.Languages(selection))
            {
                dataGridViewEdit.Columns.Add(language, language.ToUpper());
            }

            foreach (string[] words in WinFormsHelper.AllWords(selection))
            {
                dataGridViewEdit.Rows.Add(words);
            }

            practiceToolStripMenuItem.Enabled = true;
            EditButtonsSwitch();

            labelCurrentWordList.Text = $"Current list: {newList.SelectedList}";

            CurrentList = newList.SelectedList;
        }