コード例 #1
0
    public void PreviousWord(object o, EventArgs args)
    {
        if (startWordIter.Equal(Gtk.TextIter.Zero))
        {
            startWordIter = textBuffer.StartIter;
        }
        endWordIter = startWordIter;

        while (startWordIter.BackwardChar() && !startWordIter.StartsWord())
        {
        }

        curWord = startWordIter.GetText(endWordIter);

        curWord = Regex.Replace(curWord, @"--", "", RegexOptions.Multiline);
        curWord = curWord.TrimStart(new char[5] {
            ' ', '\n', '\t', '\r', '-'
        });
        curWord = curWord.TrimEnd(new char[5] {
            ' ', '\n', '\t', '\r', '-'
        });
        curWord = Regex.Replace(curWord, @"\s+", " ", RegexOptions.Multiline);
        //Console.WriteLine("Word: \"" + curWord +"\"");
        ShowWord(curWord);
        HilightWord();
        slideLock    = true;
        slider.Value = endWordIter.Offset;
        slideLock    = false;
    }