public void NewConnect(object sender, MouseEventArgs e) { CurrentConnector.UpdateCenterLocation(); Connector oldconnector = CurrentConnector; Connect connect = nodesCanvas.GetNewConnect(CurrentConnector.Position); connect.InputConnector = CurrentConnector; CurrentConnector.Connect = connect; DataObject data = new DataObject(); data.SetData("Node", this); data.SetData("Control", CurrentConnector); data.SetData("Connect", connect); DragDropEffects result = DragDrop.DoDragDrop(connect, data, DragDropEffects.Link); if (connect.OutputConnector != null) { AddEmptyConnector(); } else { nodesCanvas.connects.Remove(connect); } e.Handled = true; }
public virtual void FixOneWayLinks() { if (WrappedInstance == null) { Debug.LogError("Somehow we are running this check on objects that don't exist?"); return; } foreach (EntityLink <EntityType> CurrentConnector in WrappedInstance.InputEvents) { foreach (EntityLink <EntityType> RemoteConnector in CurrentConnector.LinkedEntities) { bool bFound = false; foreach (EntityLink <EntityType> RemoteRemoteConnector in RemoteConnector.LinkedEntities) { if (RemoteRemoteConnector.GetOwner() == CurrentConnector.GetOwner() && RemoteRemoteConnector.Name == CurrentConnector.Name) { bFound = true; break; } } if (!bFound) { bErrorInNode = true; } } } foreach (EntityLink <EntityType> CurrentConnector in WrappedInstance.OutputEvents) { foreach (EntityLink <EntityType> RemoteConnector in CurrentConnector.LinkedEntities) { bool bFound = false; foreach (EntityLink <EntityType> RemoteRemoteConnector in RemoteConnector.LinkedEntities) { if (RemoteRemoteConnector.GetOwner() == CurrentConnector.GetOwner() && RemoteRemoteConnector.Name == CurrentConnector.Name) { bFound = true; break; } } if (!bFound) { bErrorInNode = true; } } } }
public override void FixOneWayLinks() { List <EntityLink <EntityType> > Events = null; if (bIsInputBox) { Events = GetStartEntities(); } else { Events = GetEndEntities(); } if (Events != null) { foreach (EntityLink <EntityType> CurrentConnector in Events) { foreach (EntityLink <EntityType> RemoteConnector in CurrentConnector.LinkedEntities) { bool bFound = false; foreach (EntityLink <EntityType> RemoteRemoteConnector in RemoteConnector.LinkedEntities) { if (RemoteRemoteConnector.GetOwner() == CurrentConnector.GetOwner() && RemoteRemoteConnector.Name == CurrentConnector.Name) { bFound = true; break; } } if (!bFound) { bErrorInNode = true; } } } } }