\r
internal event DocumentUpdateEventHandler Update;\r
\r
+ internal void Replace(StringBuffer buf)\r
+ {\r
+ this.Replace(buf.buf);\r
+ }\r
+\r
+ internal void Replace(GapBuffer<char> buf)\r
+ {\r
+ this.Clear();\r
+ this.rwLock.EnterWriteLock();\r
+ this.buf = buf;\r
+ this.rwLock.ExitWriteLock();\r
+ this.Update(this, new DocumentUpdateEventArgs(UpdateType.Replace, 0, 0, buf.Count));\r
+ }\r
+\r
internal void Replace(int index, int length, IEnumerable<char> chars,int count)\r
{\r
this.rwLock.EnterWriteLock();\r
public void undo()
{
- this.buffer.Clear();
-
- this.buffer.Replace(0, 0, this.oldBuffer,this.oldBuffer.Length);
+ this.buffer.Replace(this.oldBuffer);
}
public void redo()
result.AddRange(Util.GetEnumrator(output),output.Length);
}
- this.buffer.Clear();
-
- this.buffer.Replace(0, 0, result,result.Count);
+ this.buffer.Replace(result);
}
public bool marge(ICommand a)