public OutputPortConfig(string _name, string _humanName, string desc, NodePortType _type, InputPortConfig[] inputPorts, OutputPortConfig[] outputPorts) : this() { name = _name; humanName = _humanName; description = desc; type = _type; inputs = inputPorts.Cast<object>().ToArray(); outputs = outputPorts.Cast<object>().ToArray(); }
public NodeConfig(FlowNodeFilter cat, string desc, FlowNodeFlags nodeFlags, FlowNodeType nodeType, InputPortConfig[] inputPorts, OutputPortConfig[] outputPorts) : this() { flags = nodeFlags; filter = cat; description = desc; type = nodeType; inputs = inputPorts.Cast<object>().ToArray(); outputs = outputPorts.Cast<object>().ToArray(); }
bool TryGetFlowNodeOutput(PortAttribute portAttribute, MemberInfo memberInfo, out OutputPortConfig outputPortConfig) { outputPortConfig = new OutputPortConfig(); if (portAttribute != null) { outputPortConfig.name = portAttribute.Name ?? memberInfo.Name; outputPortConfig.description = portAttribute.Description; } else outputPortConfig.name = memberInfo.Name; outputPortConfig.humanName = outputPortConfig.name; Type type; if (memberInfo.MemberType == MemberTypes.Field) type = (memberInfo as FieldInfo).FieldType; else type = (memberInfo as PropertyInfo).PropertyType; if (type.Name.StartsWith("OutputPort")) { bool isGenericType = type.IsGenericType; Type genericType = isGenericType ? type.GetGenericArguments()[0] : typeof(void); string prefix; outputPortConfig.type = GetFlowNodePortType(genericType, out prefix, portAttribute); return true; } return false; }