Ejemplo n.º 1
0
        void List_SelectedValueChanged(object sender, EventArgs e)
        {
            if (!this.Created)
            {
                return;
            }
            if (this.TwinList.ListEn.miShowOnlyWithWordsToolStripMenuItem.Checked)
            { // without indent
                if (this.TwinList.ListEn.CurrentSentence != null)
                {
                    this.TwinList.ListNative.SafeSelectedIndex = this.TwinList.ListEn.CurrentSentence.Index;
                }
            }
            else
            {
                this.TwinList.ListNative.SetSafeSelectedIndexWithIndent(this.TwinList.ListEn.List.SelectedIndex, this.TwinList.ListEn.CurrentSentence);
            }

            //  if (!this.TwinList.ListEn.IsOnlySynch)
            this.TwinList.HTMLScroller_SelectedIndex = this.TwinList.ListEn.CurrentSentence.Index - 1;

            if (this.TwinText.textForeignAndTran.Sentence != this.TwinList.ListEn.CurrentSentence)
            {
                this.TwinText.textForeignAndTran.Sentence = this.TwinList.ListEn.CurrentSentence;
            }


            Windows7Taskbar.CalculateAndSet(this.Parent.Handle, this.TwinList.ListEn.List.Items.Count, this.TwinList.ListEn.List.SelectedIndex);
        }
Ejemplo n.º 2
0
        void List_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                this.keyBoards.Freeze();
                this.textArea.Sentence = this.tutorList1.CurrentSentence;
                // this.txBox.Text = this.tutorList1.CurrentSentence.ToString();
            }
            finally
            {
                this.keyBoards.UnFreeze();
            }

            int startInd = this.txBox.Text.IndexOf(SentenceForTutor.CharHided);

            if (startInd != -1)
            {
                this.txBox.SelectionStart  = startInd;
                this.txBox.SelectionLength = 1;
            }

            int i = 0;

            foreach (Sentence sent in this.tutorList1.Sentences)
            {
                if (!(sent is SentenceForTutor))
                {
                    continue;
                }
                if (((SentenceForTutor)sent).IsGuessed)
                {
                    ++i;
                }
            }
            Windows7Taskbar.CalculateAndSet(this.Handle, this.tutorList1.List.Items.Count, i);
        }