public static Direction GetLinkDirection(Serialization.Node node, string name) { if (node.nodeType == NodeType.Variable && (name == Runtime.Variable.ValueLinkName || name == string.Empty)) { return(Direction.InOut); } string fieldName = FieldName(name); VariableAttribute variable = GetVariableAttribute(node.RuntimeType, fieldName); if (variable != null) { return(variable.Direction); } // test for trigger TriggerAttribute trigger = GetTriggerAttribute(node.RuntimeType, fieldName); if (trigger != null) { return(Direction.Out); } // entry EntryAttribute entry = GetEntryAttribute(node.RuntimeType, fieldName); if (entry != null) { return(Direction.In); } return(Direction.InOut); }
public static System.Type GetVariableType(Serialization.Node node, string feildName, out bool anyType) { System.Type variableType = null; anyType = false; switch (node.nodeType) { case NodeType.Variable: { MenuItemAttribute menuAttribute = GetMenuAttribute(node.RuntimeType); if (menuAttribute != null) { variableType = menuAttribute.VariableType; if (variableType == null) { anyType = true; } } break; } default: { VariableAttribute varAttribute = GetVariableAttribute(node.RuntimeType, FieldName(feildName)); if (varAttribute != null) { variableType = varAttribute.ExpectedType; if (variableType == null) { anyType = true; } } break; } } return(variableType); }