Beispiel #1
0
        void HandleWindowSelectionChanged(object sender, WindowEventArgs args)
        {
            var window = args.Window;

            if (window == null)
            {
                return;                 // Might happen during node list creation
            }
            switch (window.WindowType)
            {
            case WindowType.Patch:
            case WindowType.Module:
                ActivePatchNode = window.Node;
                //the hosts window may be null if the plugin is created hidden on startup
                if (FPluginHost.Window != null)
                {
                    FPluginHost.Window.Caption = FActivePatchNode.NodeInfo.Systemname;
                }

                //only redraw if in local scope
                if (!FNodeFilter.ScopeIsGlobal)
                {
                    UpdateView();
                }
                break;
            }

            FNodeView.SetActiveWindow(window);
        }
Beispiel #2
0
        private NodeView CreateNodeView(INode2 node)
        {
            NodeView nodeView = null;

            var nodeInfo = node.NodeInfo;

            switch (nodeInfo.Name)
            {
            case "IOBox":
                nodeView = new IONodeView(this, node, FFilter, FDepth + 1);
                break;

            case "S":
                nodeView = new SNodeView(this, node, FFilter, FDepth + 1);
                break;

            case "R":
                nodeView = new RNodeView(this, node, FFilter, FDepth + 1);
                break;

            default:
                switch (nodeInfo.Type)
                {
                case NodeType.Module:
                    nodeView = new ModuleNodeView(this, node, FFilter, FDepth + 1);
                    break;

                default:
                    nodeView = new NodeView(this, node, FFilter, FDepth + 1);
                    break;
                }
                break;
            }

            if (FLastActiveWindow != null)
            {
                nodeView.SetActiveWindow(FLastActiveWindow);
            }

            return(nodeView);
        }