private void OnFold(object?sender, FoldEventArgs e) { var action = e.Unfold ? FoldAction.Expand : FoldAction.Contract; if (e.CurrentOnly) { var index = this.Editor.LineFromPosition(this.Editor.CurrentPosition); var line = this.Editor.Lines[index]; line.FoldChildren(action); return; } if (e.Level <= 0) { this.Editor.FoldAll(action); return; } foreach (var line in Editor.Lines) { // Fold levels internally start at 1024: https://github.com/jacobslusser/ScintillaNET/issues/307#issuecomment-280809695 if (line.FoldLevel - 1023 < e.Level) { continue; } line.FoldLine(action); } }
void OnDualScreenServiceChanged(object sender, FoldEventArgs e) { UpdateLayouts(); }