|
|
@ -26,6 +26,20 @@ using ICSharpCode.SharpDevelop.Gui; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.XmlEditor |
|
|
|
namespace ICSharpCode.XmlEditor |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
public class XmlTreeViewKeyPressedEventArgs : EventArgs |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
public XmlTreeViewKeyPressedEventArgs(Keys keyData) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
KeyData = keyData; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Keys KeyData |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
get; |
|
|
|
|
|
|
|
private set; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Displays a tree of XML elements. This is a separate control so it can
|
|
|
|
/// Displays a tree of XML elements. This is a separate control so it can
|
|
|
|
/// be unit tested. It has no SharpDevelop specific parts, for example,
|
|
|
|
/// be unit tested. It has no SharpDevelop specific parts, for example,
|
|
|
@ -43,9 +57,9 @@ namespace ICSharpCode.XmlEditor |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Raised when the delete key is pressed.
|
|
|
|
/// Raised when some key in tree view is pressed.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public event EventHandler DeleteKeyPressed; |
|
|
|
public event EventHandler<XmlTreeViewKeyPressedEventArgs> TreeViewKeyPressed; |
|
|
|
|
|
|
|
|
|
|
|
public XmlTreeViewControl() |
|
|
|
public XmlTreeViewControl() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -332,8 +346,8 @@ namespace ICSharpCode.XmlEditor |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) |
|
|
|
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (keyData == Keys.Delete && DeleteKeyPressed != null) { |
|
|
|
if (/*keyData == Keys.Delete && */TreeViewKeyPressed != null) { |
|
|
|
DeleteKeyPressed(this, new EventArgs()); |
|
|
|
TreeViewKeyPressed(this, new XmlTreeViewKeyPressedEventArgs(keyData)); |
|
|
|
} |
|
|
|
} |
|
|
|
return base.ProcessCmdKey(ref msg, keyData); |
|
|
|
return base.ProcessCmdKey(ref msg, keyData); |
|
|
|
} |
|
|
|
} |
|
|
|