Ejemplo n.º 1
0
        private void label_Click(object sender, EventArgs e)
        {
            Label lbl = (Label)sender;
            int? blockNum = int.Parse(lbl.Tag as String);
            if (blockNum.HasValue)
            {
                List<String> lst = data[blockNum.Value];
                String word = "empty list!";
                if (lst.Count > 0)
                {
                    int idx = rnd.Next(0, lst.Count);
                    word = lst[idx];
                    lst.Remove(word);
                    data[blockNum.Value] = lst;
                }
                String sentance = word;
                if (lbl.Text.Contains("___"))
                {
                    sentance = lbl.Text.Replace("___", word);
                }
                WordForm child = new WordForm(sentance);
                child.Show();

            }
        }
Ejemplo n.º 2
0
        private void label_Click(object sender, EventArgs e)
        {
            Label lbl      = (Label)sender;
            int?  blockNum = int.Parse(lbl.Tag as String);

            if (blockNum.HasValue)
            {
                List <String> lst  = data[blockNum.Value];
                String        word = "empty list!";
                if (lst.Count > 0)
                {
                    int idx = rnd.Next(0, lst.Count);
                    word = lst[idx];
                    lst.Remove(word);
                    data[blockNum.Value] = lst;
                }
                String sentance = word;
                if (lbl.Text.Contains("___"))
                {
                    sentance = lbl.Text.Replace("___", word);
                }
                WordForm child = new WordForm(sentance);
                child.Show();
            }
        }