void FHierarchyViewerClick(ModelMapper sender, System.Windows.Forms.MouseEventArgs e) { if (sender == null) { if (e.Button == MouseButtons.Middle) { FHierarchyViewer.ViewAll(); } } else { var nodeView = sender.Model as NodeView; if (e.Button == MouseButtons.Left && nodeView != null) { nodeView.Selected = true; if (FActivePatchNode.Window != null && FActivePatchNode.Window.IsVisible) { FHDEHost.SelectNodes(new INode2[1] { nodeView.Node }); if (FNodeView != null && !FNodeFilter.ScopeIsLocal) { if (sender.CanMap <ICamera>()) { var camera = sender.Map <ICamera>(); var parent = nodeView.Parent; if (parent == null) { parent = FNodeView; } camera.View(parent); } } } } else if (e.Button == MouseButtons.Right && nodeView != null) { if (nodeView.Node == FActivePatchNode) { FHDEHost.ShowEditor(FActivePatchNode.Parent); } else { OpenPatch(nodeView.Node); } } } }
private void PatchEditor_OpenHostingView(uint obj) { var app = RuntimeHost.HostingAppInstances.FirstOrDefault(x => x.Object?.Context?.Path.Stack?.Peek() == obj) as NodePlugin; if (app != null) { var node = FHDEHost.GetNodeFromPath(app.PluginHost.GetNodePath(false)); var patch = FHDEHost.GetNodeFromPath(app.PluginHost.ParentNode.GetNodePath(false)); if (patch != null) { FHDEHost.ShowEditor(patch); FHDEHost.SelectNodes(new INode2[1] { node }); } } }