Exemplo n.º 1
0
        /// <summary>
        /// Constructor for when created a linked version of the node
        /// </summary>        
        /// <param name="linkedNode">The linked master node</param>                
        /// <param name="logger">The associated logger</param>        
        public NetGraphContainerNode(NetGraphContainerNode linkedNode, Logger logger)
        {
            _graph = linkedNode._graph;

            // Reverse the nodes
            _inputNode = linkedNode._outputNode;
            _outputNode = linkedNode._inputNode;

            _graph.BindEndpoint(_outputNode.Uuid, new EventDataAdapter(this));

            LinkedNode = true;

            // We don't bind logging and editing from the same graph, we assume the master did that
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor for when created a linked version of the node
        /// </summary>
        /// <param name="linkedNode">The linked master node</param>
        /// <param name="logger">The associated logger</param>
        public NetGraphContainerNode(NetGraphContainerNode linkedNode, Logger logger)
        {
            _graph = linkedNode._graph;

            // Reverse the nodes
            _inputNode  = linkedNode._outputNode;
            _outputNode = linkedNode._inputNode;

            _graph.BindEndpoint(_outputNode.Uuid, new EventDataAdapter(this));

            LinkedNode = true;

            // We don't bind logging and editing from the same graph, we assume the master did that
        }
Exemplo n.º 3
0
 private static NetGraphContainerNode.GraphDirection InvertDirection(NetGraphContainerNode.GraphDirection direction)
 {
     return direction == NetGraphContainerNode.GraphDirection.ClientToServer ?
         NetGraphContainerNode.GraphDirection.ServerToClient : NetGraphContainerNode.GraphDirection.ClientToServer;
 }
Exemplo n.º 4
0
 public EventDataAdapter(NetGraphContainerNode container)
 {
     _container = container;
 }
Exemplo n.º 5
0
 public EventDataAdapter(NetGraphContainerNode container)
 {
     _container = container;
 }
        /// <summary>
        /// On Create method
        /// </summary>
        /// <param name="logger">The logger for use during creation</param>
        /// <param name="graph">The containing graph</param>
        /// <param name="stateDictionary">Current state dictionary</param>
        /// <returns></returns>
        protected override BasePipelineNode OnCreate(Logger logger, Nodes.NetGraph graph, Dictionary<string, object> stateDictionary)
        {
            if (Factory == null)
            {
                throw new NodeFactoryException(CANAPE.Properties.Resources.NetGraphContainerFactory_MustSpecifyGraph);
            }

            // Check if we have already created this node as part of a pairing
            if(stateDictionary.ContainsKey(Id.ToString()))
            {
                return (BasePipelineNode)stateDictionary[Id.ToString()];
            }

            NetGraphContainerNode ret = new NetGraphContainerNode(Label, Factory, Direction, graph, logger, stateDictionary, LinkedNode != null);

            if (LinkedNode != null)
            {
                stateDictionary[LinkedNode.Id.ToString()] = new NetGraphContainerNode(ret, logger);
            }

            return ret;
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="guid"></param>
 /// <param name="label"></param>
 /// <param name="factory"></param>
 /// <param name="direction"></param>
 public NetGraphContainerNodeFactory(string label, Guid guid, NetGraphFactory factory, NetGraphContainerNode.GraphDirection direction)
     : base(label, guid)
 {
     Direction = direction;
     Factory = factory;
 }