/// <summary> /// Appends the contents of the specified string builder at the end of the string builder. /// </summary> /// <param name="value">The value to append.</param> /// <returns>The current instance of <see cref="VersionedStringBuilder"/>.</returns> public VersionedStringBuilder Append(VersionedStringBuilder value) { if (value != null) { for (int i = 0; i < value.Length; i++) { stringBuilder.Append(value[i]); } version++; } return(this); }
/// <summary> /// Inserts the contents of the specified string builder at the specified index within the string builder. /// </summary> /// <param name="index">The index at which to insert the value.</param> /// <param name="value">The value to insert.</param> /// <returns>The current instance of <see cref="VersionedStringBuilder"/>.</returns> public VersionedStringBuilder Insert(Int32 index, VersionedStringBuilder value) { if (value != null) { for (int i = 0; i < value.Length; i++) { stringBuilder.Insert(index + i, value[i]); } version++; } else { if (index < 0 || index > stringBuilder.Length) { throw new ArgumentOutOfRangeException("index"); } } return(this); }
/// <summary> /// Performs a pass-through conversion for an instance of the <see cref="VersionedStringBuilder"/> class. /// </summary> /// <param name="value">The string to convert.</param> /// <param name="example">An example value which will cause the compiler to perform type inference.</param> /// <returns>The value that was created.</returns> protected VersionedStringBuilder __UPF_ConvertFromString(VersionedStringBuilder value, VersionedStringBuilder example) { return(value); }
/// <summary> /// Initializes a new instance of the <see cref="VersionedStringSource"/> structure that wraps the specified <see cref="VersionedStringBuilder"/> instance. /// </summary> /// <param name="sourceStringBuilder">The <see cref="VersionedStringBuilder"/> instance which is wrapped by this buffer.</param> public VersionedStringSource(VersionedStringBuilder sourceStringBuilder) { this.sourceString = null; this.sourceStringBuilder = sourceStringBuilder; this.version = (sourceStringBuilder == null) ? 0 : sourceStringBuilder.Version; }