Esempio n. 1
0
        internal void ActivateInputPort(int portIndex, object value = null)
        {
            if (portIndex < 0 || portIndex >= this.Inputs.Count)
            {
                throw new ArgumentOutOfRangeException("portIndex");
            }
            FlowNodePort port = this.Inputs[portIndex];

            if (value == null && port.Type != NodePortType.Void)
            {
                throw new FlowGraphException("Cannot activate a node that requires a value without one.");
            }
            FlowNodePortActivationEventArgs eventArgs = new FlowNodePortActivationEventArgs
            {
                Name        = port.Name,
                DisplayName = port.DisplayName,
                Description = port.Description,
                Type        = port.Type,
                IsOutput    = false,
                Value       = value
            };

            this.OnActivated(eventArgs);
            this.Inputs[portIndex].Activate(value);
            this.OnPostActivated(eventArgs);
        }
Esempio n. 2
0
        private void ActivateOutput <T>(int portIndex, T value, Action <IntPtr, int, T> activator)
        {
            FlowNodePort port = this.Outputs[portIndex];
            FlowNodePortActivationEventArgs eventArgs = new FlowNodePortActivationEventArgs
            {
                Name        = port.Name,
                DisplayName = port.DisplayName,
                Description = port.Description,
                Type        = port.Type,
                IsOutput    = true,
                Value       = value
            };

            this.OnActivated(eventArgs);
            activator(this.Handle, portIndex, value);
            this.OnPostActivated(eventArgs);
        }
Esempio n. 3
0
        internal static void ActivateOutput(FlowGraphNode node, int portIndex)
        {
            FlowNodePort port = node.Outputs[portIndex];
            FlowNodePortActivationEventArgs eventArgs = new FlowNodePortActivationEventArgs
            {
                Name        = port.Name,
                DisplayName = port.DisplayName,
                Description = port.Description,
                Type        = port.Type,
                IsOutput    = true,
                Value       = null
            };

            node.OnActivated(eventArgs);
            Native.FlowNodeInterop.ActivateOutput(node.Handle, portIndex);
            node.OnPostActivated(eventArgs);
        }