// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.SharpDevelop.Editor
{
///
/// Describes a change of the document text.
/// This class is thread-safe.
///
public class TextChangeEventArgs : EventArgs
{
///
/// The offset at which the change occurs.
///
public int Offset { get; private set; }
///
/// The text that was inserted.
///
public string RemovedText { get; private set; }
///
/// The number of characters removed.
///
public int RemovalLength {
get { return RemovedText.Length; }
}
///
/// The text that was inserted.
///
public string InsertedText { get; private set; }
///
/// 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;
}
}
}