/// <summary> /// Tests if a module is in this layer</summary> /// <param name="element">Module to test</param> /// <returns>True iff module is in this layer</returns> public bool Contains(Element element) { foreach (ElementRef reference in ElementRefs) if (reference.Element == element) return true; return false; }
private bool IsDraggingSubNode(Element element) { if (element != null && m_moduleEditAdapter != null && m_moduleEditAdapter.NodeDraggingPosition(element).HasValue) { if (element.DomNode.Parent.Is<Group>()) return true; } return false; }
//CircuitEditingContext callback internal static RectangleF GetLocalBound(AdaptableControl adaptableControl, Element moudle) { var graphAdapter = adaptableControl.Cast<D2dGraphAdapter<Module, Connection, ICircuitPin>>(); return graphAdapter.GetLocalBound(moudle.DomNode.Cast<Module>()); }
private static Wire CircuitAddEdge(Element fromNode, int fromPinIndex, Element toNode, int toPinIndex) { DomNode domNode = new DomNode(Schema.connectionType.Type); Wire connection = domNode.As<Wire>(); connection.OutputElement = fromNode; connection.OutputPin = fromNode.Type.Outputs[fromPinIndex]; connection.InputElement = toNode; connection.InputPin = toNode.Type.Inputs[toPinIndex]; connection.SetPinTarget(); connection.Cast<WireStyleProvider<Module, Connection, ICircuitPin>>().EdgeStyle = EdgeStyle.DirectCurve; return connection; }