private void DeleteChars(int pos, int l) { if (l == 0) { return; } UserText = UserText.Substring(0, pos) + UserText.Substring(pos + l); }
private bool InsertChar(int pos, char ch) { if (string.IsNullOrEmpty(Text)) { UserText = ch.ToString(); } else { UserText = UserText.Substring(0, pos) + ch + UserText.Substring(pos); } return(true); }
private bool InsertChars(int pos, string s) { if (string.IsNullOrEmpty(s)) { return(false); } if (string.IsNullOrEmpty(Text)) { UserText = s; } else { UserText = UserText.Substring(0, pos) + s + UserText.Substring(pos); } return(true); }
public void Replace(int where, int len, string text) { if (len <= 0) { Insert(where, text); return; } text = Process(text); if (string.IsNullOrEmpty(text)) { Delete(where, len); return; } UndoStack.MakeReplace(Text, where, len, text.Length); UserText = UserText.Substring(0, where) + text + UserText.Substring(where + len); }
protected void DeleteCharacter() { if (UserText.Length >= 1) { UserText = UserText.Substring(0, UserText.Length - 1); if (Building.Text.Length == 0 && Runs.Count > 0) { Building = Runs.Last.Value; Runs.RemoveLast(); } if (Building.Text.Length > 0) { Building.Text = Building.Text.Substring(0, Building.Text.Length - 1); } UpdateParagraph(); } }