public NodeConfig <TNode> InputAlias(string inputName) { var config = new NodeInputConfig() { Name = new ConfigProperty <IDiagramNodeItem, string>(inputName), IsInput = true, IsOutput = false, SourceType = typeof(TNode), ReferenceType = typeof(TNode), IsAlias = true }; GraphItemConfigurations.Add(config); return(this); }
public NodeConfig <TNode> Input <TSourceType, TReferenceType>(string inputName, bool allowMultiple, Func <IDiagramNodeItem, IDiagramNodeItem, bool> validator = null) where TReferenceType : GenericSlot, new() where TSourceType : class, IConnectable { var config = new NodeInputConfig() { Name = new ConfigProperty <IDiagramNodeItem, string>(inputName), IsInput = true, IsOutput = false, ReferenceType = typeof(TReferenceType), SourceType = typeof(TSourceType), Validator = validator }; GraphItemConfigurations.Add(config); return(this); }
private GraphItemConfiguration CreateSlotConfiguration(PropertyInfo property, Slot slot) { var config = new NodeInputConfig() { Name = new ConfigProperty <IDiagramNodeItem, string>(slot.Name), IsInput = slot is InputSlot, IsOutput = slot is OutputSlot, Visibility = slot.Visibility, ReferenceType = property.PropertyType, SourceType = slot.SourceType ?? property.PropertyType.GetGenericParameter(), PropertyInfo = property, AttributeInfo = slot, Tint = slot.Tint, Style = slot.Style }; return(config); }