protected override void filterForConnection(CanvasNode node, connectionRule rule) { foreach (CanvasNode gn in mNodes) { Type gnType = gn.GetType(); if (!rule.isValidType(gnType)) { if (!(gn is ConnectionPoint)) { gn.IsVisible = true; } else { gn.IsVisible = false; } gn.IsEnabled = false; } else { ConnectionPoint cp = node as ConnectionPoint; ConnectionPoint cpg = gn as ConnectionPoint; if (cp.OwnerNode == cpg.OwnerNode || cp.ParamType.Type != cpg.ParamType.Type) { gn.IsVisible = false; gn.IsEnabled = false; } } } }
protected virtual void filterForConnection(CanvasNode node, connectionRule rule) { foreach (CanvasNode gn in mNodes) { if (rule.isInvalidType(gn.GetType())) { gn.IsVisible = false; gn.IsEnabled = false; } } }
public void addConnectionRule(Type targetType, Type[] validConnectionTypes, Type[] invalidConnectionTypes) { connectionRule cr = new connectionRule(); cr.mTargetType = targetType; cr.mInvalidConnectType = new Type[invalidConnectionTypes.Length]; invalidConnectionTypes.CopyTo(cr.mInvalidConnectType, 0); cr.mValidConnectType = new Type[validConnectionTypes.Length]; validConnectionTypes.CopyTo(cr.mValidConnectType, 0); mConnectionRules.Add(cr); }