private void componentTreeView_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyData == Keys.Delete)
{
if (componentTreeView.SelectedNode == null)
return;
String componentName;
try
{
componentName = componentTreeView.SelectedNode.Text;
}
catch(NullReferenceException exp)
{
rootView.logView.logWarning("No component selected!");
return;
}
switch(getTargetType())
{
case EntityEditTargetType.TARGET_ENTITY:
uint componentId = uint.Parse(componentTreeView.SelectedNode.Name);
rootView.operationManagerInstance.removeComponent(instance, targetId, componentId);
break;
case EntityEditTargetType.TARGET_TYPE:
rootView.operationManagerInstance.removeComponentOnType(instance, name, componentName);
break;
}
}
}