Esempio n. 1
0
 void _ParseTree_TextChanged(object sender, ParseTreeTextChangedEventArgs e)
 {
     foreach (var os in AllItems.Where(os => os.item.IsChildOfOrSelf(e.ChangedItem)))
         os.AdjustPosition(TikzToScreen);
 }
Esempio n. 2
0
        void OnParseTreeTextChanged(object sender, ParseTreeTextChangedEventArgs e)
        {
            if (e.ChangedItem != null)
            {
                int InsertAt = e.ChangedItem.StartPosition();
                if (InsertAt > Document.Text.Length)
                {
                    MainWindow.AddStatusLine("Trying to insert code \"" + e.ChangedItem.ToString().Replace(Environment.NewLine, "<NEWLINE>") + "\" to position " + e.ChangedItem.StartPosition() + " but document has only " + Document.Text.Length + " characters."
                    + " Inserting code at end of document instead. Code does probably not compile now. Please correct or choose undo.", true);
                    InsertAt = Document.Text.Length;
                }

                Document.Replace(InsertAt, e.OldText.Length, e.ChangedItem.ToString());
            }
        }