protected virtual void tb_LineInserted(object sender, LineInsertedEventArgs e) { for (int i = 0; i < Count; i++) { if (items[i].LineIndex >= e.Index) { items[i].LineIndex = items[i].LineIndex + e.Count; } } }
private void tasText_LineInserted(object sender, LineInsertedEventArgs e) { RichText tas = (RichText)sender; int count = e.Count; while (count-- > 0) { InputRecord input = new InputRecord(tas.GetLineText(e.Index + count)); Lines.Insert(e.Index, input); totalFrames += input.Frames; } UpdateStatusBar(); }
private void uxEditor_LineInserted(object sender, LineInsertedEventArgs e) { // This event is used to keep Roslyn text in 1:1 sync with FastColoredTextBox text. See comment at top of file. StartRecolorize(false); if (CurrentText != null) { var sb = new StringBuilder(); for (int i = 0; i < e.Count; i++) { sb.AppendLine(); } int previousSpanStart = e.Index >= PreviousLineLengths.Count ? CurrentText.Length : LineToPosition(e.Index); UpdateCurrentText(previousSpanStart, 0, sb.ToString()); } PreviousLineLengths.InsertRange(e.Index, Enumerable.Repeat(0, e.Count)); }
protected virtual void TextBoxLineInserted(object sender, LineInsertedEventArgs e) { for (var i = 0; i < Count; i++) { if (Items[i].LineIndex >= e.Index) { Items[i].LineIndex = Items[i].LineIndex + e.Count; } else if (Items[i].LineIndex == e.Index - 1 && e.Count == 1) { if (TextBox[e.Index - 1].StartSpacesCount == TextBox[e.Index - 1].Count) { Items[i].LineIndex = Items[i].LineIndex + e.Count; } } } }
protected virtual void tb_LineInserted(object sender, LineInsertedEventArgs e) { for (int i = 0; i < Count; i++) { if (items[i].LineIndex >= e.Index) { items[i].LineIndex = items[i].LineIndex + e.Count; } else if (items[i].LineIndex == e.Index - 1 && e.Count == 1) { if (tb[e.Index - 1].StartSpacesCount == tb[e.Index - 1].Count) { items[i].LineIndex = items[i].LineIndex + e.Count; } } } }
void CSyntaxHighlighter_LineInserted(object sender, LineInsertedEventArgs e) { Thread searchThread = new Thread(() => CSyntaxHighlighter_LineInserted_Threaded(new object[] { this, e.Index })); searchThread.IsBackground = true; if (e.Index > 0) { string lineText = this.GetLine(e.Index - 1).Text; if (lineText.ToLower().StartsWith("#include ")) //process include, might take awhile so using spearate thread { searchThread.Start(); } if (oldLines != null) { return; } if (isLineDeclaration(lineText, this.Lines.ToArray(), e.Index - 1)) { List <AutocompleteItem> items = parseLine(lineText, e.Index, new System.IO.FileInfo(this.Name).Name); if (items != null) { foreach (AutocompleteItem item in items) { for (int a = 0; a < AutoCompleteWords.Count; a++) { if (AutoCompleteWords[a].Text == item.Text) { goto skip; } } AutoCompleteWords.Add(item); skip :; } } } SetAutoCompleteItems(); } }
private void Command_LineInserted(object sender, LineInsertedEventArgs e) { this.ResizeAll(); }