本文整理汇总了C#中TextChange.Normalize方法的典型用法代码示例。如果您正苦于以下问题:C# TextChange.Normalize方法的具体用法?C# TextChange.Normalize怎么用?C# TextChange.Normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextChange
的用法示例。
在下文中一共展示了TextChange.Normalize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyChange
public virtual EditResult ApplyChange(Span target, TextChange change, bool force)
{
var result = PartialParseResult.Accepted;
var normalized = change.Normalize();
if (!force)
{
result = CanAcceptChange(target, normalized);
}
// If the change is accepted then apply the change
if ((result & PartialParseResult.Accepted) == PartialParseResult.Accepted)
{
return new EditResult(result, UpdateSpan(target, normalized));
}
return new EditResult(result, new SpanBuilder(target));
}
示例2: NormalizeDoesntAffectShrinkingReplacements
public void NormalizeDoesntAffectShrinkingReplacements()
{
// Arrange
var newBuffer = new StringTextBuffer("D");
var oldBuffer = new StringTextBuffer("DateTime");
var original = new TextChange(0, 8, oldBuffer, 1, newBuffer);
// Act
var normalized = original.Normalize();
// Assert
Assert.Equal(original, normalized);
}
示例3: NormalizeDoesntAffectChangesWithoutCommonPrefixes
public void NormalizeDoesntAffectChangesWithoutCommonPrefixes()
{
// Arrange
var newBuffer = new StringTextBuffer("DateTime.");
var oldBuffer = new StringTextBuffer("Date.");
var original = new TextChange(0, 5, oldBuffer, 9, newBuffer);
// Act
var normalized = original.Normalize();
// Assert
Assert.Equal(original, normalized);
}
示例4: NormalizeFixesUpIntelliSenseStyleReplacements
public void NormalizeFixesUpIntelliSenseStyleReplacements()
{
// Arrange
var newBuffer = new StringTextBuffer("Date.");
var oldBuffer = new StringTextBuffer("Date");
var original = new TextChange(0, 4, oldBuffer, 5, newBuffer);
// Act
var normalized = original.Normalize();
// Assert
Assert.Equal(new TextChange(4, 0, oldBuffer, 1, newBuffer), normalized);
}