Skip to content

Commit

Permalink
add Insert method overload
Browse files Browse the repository at this point in the history
  • Loading branch information
MeilCli committed Apr 2, 2017
1 parent 08762c7 commit 20b7cee
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/Plugin.CrossFormattedText.Abstractions/FormattedString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,21 @@ public FormattedString Insert(int startIndex,string value) {
}

public FormattedString Insert(int startIndex,string value,SpanOperand operand) {
return Insert(startIndex,value,null,operand);
}

public FormattedString Insert(int startIndex,Span span) {
if(span == null) {
throw new ArgumentNullException(nameof(span));
}
return Insert(startIndex,span.Text,span);
}

public FormattedString Insert(int startIndex,string value,Span span) {
return Insert(startIndex,value,span,SpanOperand.Right);
}

internal FormattedString Insert(int startIndex,string value,Span span,SpanOperand operand) {
if(startIndex < 0 || startIndex >= TextLength) {
throw new ArgumentOutOfRangeException(nameof(startIndex));
}
Expand Down

0 comments on commit 20b7cee

Please sign in to comment.