public void Format() { scintilla.BeginUndoAction(); int textLength = scintilla.GetTextLength(); string text = scintilla.GetText(textLength); text = FormatText(text); scintilla.DeleteRange(new Position(0), textLength); scintilla.InsertText(new Position(0), text); scintilla.EndUndoAction(); }
private int InsertGuids(Tuple <Position, int>[] selections) { var sumChanges = selections.Sum(x => { scintilla.DeleteRange(x.Item1, x.Item2); scintilla.InsertText(x.Item1, Guid.NewGuid().ToString()); return(GuidHelperConstants.Regexlength - x.Item2); }); return(sumChanges); }
private int InsertGuids(Tuple <Position, int>[] selections, bool makeUppercase) { var sumChanges = selections.Sum(x => { var guid = makeUppercase ? Guid.NewGuid().ToString().ToUpper() : Guid.NewGuid().ToString(); scintilla.DeleteRange(x.Item1, x.Item2); scintilla.InsertText(x.Item1, guid); return(GuidHelperConstants.Regexlength - x.Item2); }); return(sumChanges); }