// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT license (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.Editor
{
///
/// Describes a change of the document text.
/// This class is thread-safe.
///
[Serializable]
public class TextChangeEventArgs : EventArgs
{
readonly int offset;
readonly string removedText;
readonly string insertedText;
///
/// The offset at which the change occurs.
///
public int Offset {
get { return offset; }
}
///
/// The text that was inserted.
///
public string RemovedText {
get { return removedText; }
}
///
/// The number of characters removed.
///
public int RemovalLength {
get { return removedText.Length; }
}
///
/// The text that was inserted.
///
public string InsertedText {
get { return insertedText; }
}
///
/// The number of characters inserted.
///
public int InsertionLength {
get { return insertedText.Length; }
}
///
/// Creates a new TextChangeEventArgs object.
///
public TextChangeEventArgs(int offset, string removedText, string insertedText)
{
this.offset = offset;
this.removedText = removedText ?? string.Empty;
this.insertedText = insertedText ?? string.Empty;
}
}
}