Example #1
0
        public static NodeGraphNode FromModuleDescriptor(NuiApiWrapper.ModuleDescriptor module, NodeGraphView p_View)
        {
//             string className = typeof(NodeGraphNode).Name;
//
//             object[] arguments = { module, p_View };
//
//             object v_Out = System.Reflection.Assembly.GetEntryAssembly().CreateInstance(className, false,
//                                                                                     System.Reflection.BindingFlags.CreateInstance,
//                                                                                     null,
//                                                                                     arguments, System.Globalization.CultureInfo.GetCultureInfo("fr-fr"),
//                                                                                     null);

            return(new NodeGraphNode(module, p_View));
        }
Example #2
0
        /// <summary>
        /// CONVERTATION : Creates a NodeGraphNode from a XML Serialized Copy
        /// </summary>
        /// <param name="p_Input"></param>
        /// <param name="p_View"></param>
        public NodeGraphNode(ModuleDescriptor descriptor, NodeGraphView p_View)
        {
            this.m_oView = p_View;
            this.m_sName = descriptor.name;
            this.m_sComment = descriptor.description;
            ///! TODO : X,Y ? set later?
            //this.X = ;
            //this.Y = ;
            this.Width = 80;
            this.Height = 40;
            this.m_bCanBeSelected = true;
            this.m_Connectors = new List<NodeGraphConnector>();
            foreach (var inputEndpoint in descriptor.inputEndpoints)
            {
                this.m_Connectors.Add(new NodeGraphConnector(inputEndpoint, this, ConnectorType.InputConnector));
            }

            foreach (var outputEndpoint in descriptor.outputEndpoints)
            {
                this.m_Connectors.Add(new NodeGraphConnector(outputEndpoint, this, ConnectorType.OutputConnector));
            }
        }