private void OnContextMenuClick(object sender, EventArgs e)
{
NodeEventArgs arg = e as NodeEventArgs;
if (arg != null)
{
switch (arg.Action)
{
case NodeAction.Properties:
OnShowPropertiesEvent(this.SelectedObject);
break;
case NodeAction.Edit:
OnEditEvent(this.SelectedObject);
break;
case NodeAction.References:
OnShowReferencesDiagramEvent(this.SelectedObject);
break;
case NodeAction.Remove:
if (this.SelectedNode != null)
{
if (AskConfirmDelete(this.SelectedNode.Name))
{
OnAction(this.SelectedNode, arg.Action);
}
}
break;
case NodeAction.Exclude:
case NodeAction.New:
case NodeAction.Manage:
case NodeAction.Build:
case NodeAction.Rebuild:
if (this.SelectedNode != null)
{
OnAction(this.SelectedNode, arg.Action);
}
break;
case NodeAction.OpenFolder:
if (this.SelectedWrapper != null)
{
string path = string.Empty;
BaseWrapper wrapper = this.SelectedWrapper;
if (wrapper is BuildFileWrapper)
{
path = (wrapper as BuildFileWrapper).FullPath;
}
if (wrapper is IProjectPath)
{
path = PK.Wrapper.ExpandPath((wrapper as IProjectPath).ProjectPath);
}
if (string.IsNullOrEmpty(path) != true)
{
OnOpenContainingFolderEvent(path);
}
}
break;
default:
break;
}
}
}