Beispiel #1
0
        public Node CreateDefaultNode(ValueType valueType)
        {
            NodeCollector.NodeInfo info = NodeCollector.DefaultNodes[(int)valueType];
            if (info == null)
            {
                return(null);
            }
            Node node = (Node)info.Type.GetConstructor(new Type[0]).Invoke(new object[0]);

            node.NodeId = --_lastDefaultNodeId;
            Nodes.Add(node.NodeId, node);
            return(node);
        }
Beispiel #2
0
        Node CteateIO(ValueType valueType, string name, IOMode mode, out bool createdNewOne)
        {
            createdNewOne = false;
            NodeCollector.NodeInfo info = NodeCollector.IOTypes[(int)valueType];
            if (info == null)
            {
                throw new Exception("Wrong ValueType");
            }
            ValueNode vn;

            if (!TempIONodes.TryGetValue(name, out vn))
            {
                vn            = (ValueNode)CreateNode(info.TypeID);
                vn.ValueName  = name;
                createdNewOne = true;
            }
            else
            {
                TempIONodes.Remove(name);
            }

            vn.IOMode = mode;
            return(vn);
        }