public static SlotInfo From(NodeInfo nodeInfo, Slot slot) { SlotInfo slotInfo; if (!slotInfos.TryGetValue(slot, out slotInfo)) slotInfos.Add(slot, slotInfo = new SlotInfo(nodeInfo, slot)); return slotInfo; }
private LinkInfo(NodeInfo nodeInfo, Slot slot, Node node) { Slot = slot; SlotInfo = SlotInfo.From(nodeInfo, slot); SlotInfo.PropertyChanged += SlotInfo_PropertyChanged; Node = node; NodeInfo = NodeInfo.From(nodeInfo.FlowInfo, node); NodeInfo.PropertyChanged += NodeInfo_PropertyChanged; }
private void Slot_MouseDown(object sender, MouseButtonEventArgs e) { Border border = sender as Border; ContentPresenter contentPresenter = VisualTreeHelper.GetParent(border) as ContentPresenter; SlotInfo slotInfo = Slots.ItemContainerGenerator.ItemFromContainer(contentPresenter) as SlotInfo; if (SlotMouseDown != null) { SlotMouseDown(slotInfo, e); } }
public static SlotInfo From(NodeInfo nodeInfo, Slot slot) { SlotInfo slotInfo; if (!slotInfos.TryGetValue(slot, out slotInfo)) { slotInfos.Add(slot, slotInfo = new SlotInfo(nodeInfo, slot)); } return(slotInfo); }
private void NodeControl_SlotMouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Released || Keyboard.IsKeyDown(Key.Space)) { return; } SlotInfo slotInfo = sender as SlotInfo; Border border = e.OriginalSource as Border; Anchor anchor = VisualTreeHelper.GetChild(border, 0) as Anchor; newLinkSlot = slotInfo; SourceAnchorBinder.Anchor = anchor; DestinationAnchorBinder.Anchor = anchor; creatingNewLink = true; NotifyPropertyChanged(nameof(SourceAnchorBinder)); NotifyPropertyChanged(nameof(DestinationAnchorBinder)); NotifyPropertyChanged(nameof(NewLinkVisibility)); }
private void NodeControl_SlotMouseDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Released || Keyboard.IsKeyDown(Key.Space)) return; SlotInfo slotInfo = sender as SlotInfo; Border border = e.OriginalSource as Border; Anchor anchor = VisualTreeHelper.GetChild(border, 0) as Anchor; newLinkSlot = slotInfo; SourceAnchorBinder.Anchor = anchor; DestinationAnchorBinder.Anchor = anchor; creatingNewLink = true; NotifyPropertyChanged(nameof(SourceAnchorBinder)); NotifyPropertyChanged(nameof(DestinationAnchorBinder)); NotifyPropertyChanged(nameof(NewLinkVisibility)); }
public AddLinkAction(SlotInfo slotInfo, NodeInfo nodeInfo) { SlotInfo = slotInfo; NodeInfo = nodeInfo; }