// DELETE NODE // This method deletes the selected node, then links the two nodes on either side of it. public void deleteNode() { DataTypes.Node gonerNode = selectedNode; // We use the first TimePosition of the note to be deleted as a reference point (why?) // float deletePoint = gonerNode.TimePosition[0]; // We then go through each nextNode in for (int i = 0; i < gonerNode.NextNode.Count; i++) { DataTypes.Node newNextNode = gonerNode.NextNode[i]; DataTypes.Node newPrevNode = gonerNode.PrevNode[i]; foreach (DataTypes.Node node in newPrevNode.NextNode) { if (node == gonerNode) { gonerNode.NextNode[i] = newNextNode; } } foreach (DataTypes.Node node in newNextNode.PrevNode) { if (node == gonerNode) { gonerNode.NextNode[i] = newPrevNode; } } } foreach (float time in gonerNode.TimePosition) { listofUsedBeats.Remove(time); listofAvailableBeats.Add(time); } currentLoop.NodeList.Remove(gonerNode); NodeMenu nodeMenu = FindObjectOfType <NodeMenu>(); // TODO: Graphical representation. updateGraphics(); // FROM A PREVIOUS VERSION OF THIS METHOD WHICH DELETED ALL FUTURE NODES OR TIME POSITIONS /*foreach (DataTypes.Node node in currentLoop.NodeList){ * if (node.TimePosition[0]>= deletePoint){ * currentLoop.NodeList.Remove(node); * } * else if (currentLoop.NodeList.Count > 1){ * foreach (DataTypes.Node prevNode in node.PrevNode){ * if (prevNode.TimePosition[0] >= deletePoint) * node.PrevNode.Remove(prevNode); * } * foreach (float time in node.TimePosition){ * if (time >= deletePoint){ * int index = node.TimePosition.IndexOf(time); * node.TimePosition.RemoveAt[index]; * foreach (DataTypes.Node nextNode in node.NextNode){ * if (nextNode.TimePosition) * } * } * } * } * }*/ }
private void MenuGrid_PointerExited(object sender, PointerRoutedEventArgs e) { Grid grid = (Grid)sender; NodeMenu nodeMenu = grid.Tag as NodeMenu; grid.Background = ColorConverter.GetSolidColorBrush((!nodeMenu.Active) ? GridColor : ActiveGridColor); Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 2); }
/// <summary> Returns context node menu path. Null or empty strings for hidden nodes </summary> private static string GetNodeMenuName(Type type, out NodeMenu nodeMenu) { //check if type has the NodeMenu attribute NodeMenu attribute; //if it has the attribute -> return the custom MenuName -> otherwise return the type as a namespace path string namespacePath = ReflectionUtils.GetAttribute(type, out attribute) ? attribute.MenuName : ObjectNames.NicifyVariableName(type.ToString().Replace('.', '/')); nodeMenu = attribute; return(namespacePath); }
public Add(string code, NodeMenu menu) { InitializeComponent(); this.cb_menuType.SelectedIndex = 0;//默认值 //默认选中checkbox { ckb_isSysDefined.Checked = true; ckb_isvisible.Checked = true; ckb_isEnd.Checked = true; txt_url.Text = "#"; } this.txt_codeParent.Text = code; }
private void MenuNode_Tapped(object sender, TappedRoutedEventArgs e) { NodeMenu selectedNodeMenu = (NodeMenu)(sender as MenuButton).Tag; foreach (NodeMenu nodeMenu in Menu.Nodes) { if (nodeMenu.Active && nodeMenu != selectedNodeMenu) { nodeMenu.Active = false; } } selectedNodeMenu.Active = true; selectedNodeMenu.LinkIt(); }
public void Start() { if (map == null) { map = FindObjectOfType <Map>(); } if (economy == null) { economy = FindObjectOfType <Economy>(); } if (nodeMenu == null) { nodeMenu = FindObjectOfType <NodeMenu>(); } onTurnEnd += economy.OnTurnEnd; onTurnStart += economy.OnTurnStart; }
private void FillFullHorizontalMenu() { FullHorizontalMenu = new Menu(); NodeMenu nodeMenu = new NodeMenu() { Active = true, Title = "Scrum board", FuncListener = FullHorizontalMenuNodeClicked, Parameter = typeof(Views.Project.Forum.Forum) }; FullHorizontalMenu.Nodes.Add(nodeMenu); NodeMenu nodeMenu2 = new NodeMenu() { Active = false, Title = "Forum", FuncListener = FullHorizontalMenuNodeClicked, Parameter = typeof(Views.Project.CreateProject) }; FullHorizontalMenu.Nodes.Add(nodeMenu2); NodeMenu nodeMenu3 = new NodeMenu() { Active = false, Title = "Chat", FuncListener = FullHorizontalMenuNodeClicked, Parameter = typeof(Views.Project.Forum.Forum) }; FullHorizontalMenu.Nodes.Add(nodeMenu3); NodeMenu nodeMenu4 = new NodeMenu() { Active = false, Title = "Equipe", FuncListener = FullHorizontalMenuNodeClicked, Parameter = typeof(Views.Project.Forum.Forum) }; FullHorizontalMenu.Nodes.Add(nodeMenu4); }
private void tvRegions_MouseUp(object sender, MouseEventArgs e) { // only need to change selected note during right-click - otherwise tree does // fine by itself if (e.Button == MouseButtons.Right) { Point pt = new Point(e.X, e.Y); tvRegions.PointToClient(pt); TreeNode Node = tvRegions.GetNodeAt(pt); if (Node != null) { if (Node.Bounds.Contains(pt)) { tvRegions.SelectedNode = Node; // ResetContextMenu(); NodeMenu.Show(tvRegions, pt); } } } }
private void InitMenuWithSearch() { MenuWithSearch = new MenuWithSearchAndButtonsContainer(); MenuWithSearch.Name = "Topics"; MenuWithSearch.MenuTheme = Theme.Dark; NodeMenu node = new NodeMenu() { Title = "General", NodeTheme = Theme.Dark, Active = true, FuncListener = MenuWithSearchNodeClicked }; NodeMenu node2 = new NodeMenu() { Title = "Design", NodeTheme = Theme.Dark, Active = false, FuncListener = MenuWithSearchNodeClicked }; NodeMenu node3 = new NodeMenu() { Title = "User needs", NodeTheme = Theme.Dark, Active = false, FuncListener = MenuWithSearchNodeClicked }; NodeMenu nodeButton = new NodeMenu() { Title = "+ Nouveau topic", NodeTheme = Theme.Dark }; MenuWithSearch.Nodes.Add(node); MenuWithSearch.Nodes.Add(node2); MenuWithSearch.Nodes.Add(node3); MenuWithSearch.Buttons.Add(nodeButton); }
public NodeMenuItem(NodeMenu menu, Type nodeType) { Menu = menu; NodeType = nodeType; }