Example #1
0
        public TextReplaceElement
        (
            TextReplaceWindow _tpwindow,
            FuncBlockViewModel _fbvmodel,
            int _textoffset,
            string _word
        )
        {
            tpwindow              = _tpwindow;
            fbvmodel              = _fbvmodel;
            fbvmodel.TextChanged += OnTextChanged;
            Offset = _textoffset;
            word   = _word;
            string text  = fbvmodel.Code;
            int    start = textoffset - 1;
            int    end   = textoffset + word.Length;

            while (start >= 0 && text[start] != '\n' && text[start] != '\r')
            {
                start--;
            }
            while (end < text.Length && text[end] != '\n' && text[end] != '\r')
            {
                end++;
            }
            Line       = text.Substring(start + 1, end - start - 1);
            lineoffset = textoffset - start - 1;
        }
Example #2
0
 public FuncBlockReplaceWordCommand_Group
 (
     TextReplaceWindow tpwindow,
     IEnumerable <TextReplaceElement> tpelements
 )
 {
     parent   = tpwindow;
     eles_all = tpelements;
 }
Example #3
0
 public void Dispose()
 {
     tpwindow              = null;
     fbvmodel.TextChanged -= OnTextChanged;
     fbvmodel              = null;
 }