添加项目文件。

This commit is contained in:
ShrlAlgo
2025-09-16 16:06:41 +08:00
parent 0e7807b826
commit 98c65ceb3d
922 changed files with 1009489 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
using ICSharpCode.AvalonEdit.Document;
using System;
namespace ScriptPad
{
class CSIndentationStrategy : ICSharpCode.AvalonEdit.Indentation.IIndentationStrategy
{
string IndentationString = " ";
public void IndentLine(ICSharpCode.AvalonEdit.Document.TextDocument document, DocumentLine line)
{
if (document == null)
throw new ArgumentNullException("document");
if (line == null)
throw new ArgumentNullException("line");
DocumentLine previousLine = line.PreviousLine;
if (previousLine != null)
{
ISegment indentationSegment = TextUtilities.GetWhitespaceAfter(document, previousLine.Offset);
string indentation = document.GetText(indentationSegment);
if (previousLine.EndOffset > 0)
{
var c = document.GetCharAt(previousLine.EndOffset - 1);
if (c == '{')
{
//indentation += IndentationString;
indentationSegment = TextUtilities.GetWhitespaceAfter(document, line.Offset);
document.Replace(indentationSegment.Offset, indentationSegment.Length, indentation, OffsetChangeMappingType.RemoveAndInsert);
}
else
{
indentationSegment = TextUtilities.GetWhitespaceAfter(document, line.Offset);
document.Replace(indentationSegment.Offset, indentationSegment.Length, indentation, OffsetChangeMappingType.RemoveAndInsert);
}
}
}
}
public void IndentLines(ICSharpCode.AvalonEdit.Document.TextDocument document, int beginLine, int endLine)
{
}
}
}