private void AddMenuItem_Click(object sender, EventArgs e) { var menu = sender as ToolStripItem; var newConnection = ProjectManager.AddConnection((ConnectorType)menu.Tag, null); SetCurrentObject(newConnection, false); }
private void AddConnectionMenuItem_Click(object sender, EventArgs e) { string connectionTypeStr = (sender as ToolStripMenuItem).Tag as string; if (!string.IsNullOrEmpty(connectionTypeStr) && Enum.TryParse(connectionTypeStr, out LDD.Primitives.Connectors.ConnectorType connectorType)) { var focusedBoneNode = GetFocusedParentElement <PartBone>(); var newConnection = ProjectManager.AddConnection(connectorType, focusedBoneNode?.Element as PartBone); if (newConnection != null) { SelectElementNodeDelayed(newConnection); } } }