#region Using Directives
using System;
using System.Text;
#endregion Using Directives
namespace ScintillaNET
{
///
/// Provides data for the AutoCompleteAccepted event
///
public class AutoCompleteAcceptedEventArgs : EventArgs
{
#region Fields
private string _text;
private int _wordStartPosition;
private bool _cancel = false;
#endregion Fields
#region Properties
///
/// Gets/Sets if the autocomplete action should be cancelled
///
public bool Cancel
{
get
{
return _cancel;
}
set
{
_cancel = value;
}
}
///
/// Text of the selected autocomplete entry selected
///
public string Text
{
get { return _text; }
}
///
/// Returns the _start position of the current word in the document.
///
///
/// This controls how many characters of the selected autocomplete entry
/// is actually inserted into the document
///
public int WordStartPosition
{
get
{
return _wordStartPosition;
}
}
#endregion Properties
#region Constructors
internal AutoCompleteAcceptedEventArgs(SCNotification eventSource, Encoding encoding)
{
_wordStartPosition = (int)eventSource.lParam;
_text = Utilities.IntPtrToString(encoding, eventSource.text);
}
///
/// Initializes a new instance of the AutoCompleteAcceptedEventArgs class.
///
/// Text of the selected autocomplete entry selected
public AutoCompleteAcceptedEventArgs(string text)
{
_text = text;
}
#endregion Constructors
}
}