void OnMenuItemClick(TreeNodeButton node) { if (OnNodeClick != null) { OnNodeClick(node); } }
private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { if (_OnInitLoad) { return; } if (e.Node == null) { return; } if (e.Node.TreeList.FocusedColumn == null) { return; } _SelectedNode = (TreeNodeButton)treeList1.GetDataRecordByNode(e.Node); if (_SelectedNode != null) { OnMenuItemClick(_SelectedNode); } }
/// <summary> /// Actualiza un simplebuton /// </summary> /// <param name="ButtonBase_Updated">ButtonBase o item con los nuevos valores /// conserva el GUID</param> public void Update_ItemFromGroup(Fwk.UI.Controls.Menu.ButtonBase buttonBase_Updated) { BarGroup wBarGroup = (BarGroup)this.ActiveGroup.Tag; //BarGroup wBarGroupX = _MenuBar.GetBy_Guid(wBarGroup.Guid); if ((wBarGroup).ContainTree) { Fwk.UI.Controls.Menu.TreeNodeButton originalButtonBase = wBarGroup.MenuBarTree.GetBy_Guid(buttonBase_Updated.Guid); originalButtonBase.Map((TreeNodeButton)buttonBase_Updated); //wBarGroup.MenuBarTree. UC_TreeNavBar treeList = (UC_TreeNavBar)((System.Windows.Forms.Control)(this.ActiveGroup.ControlContainer)).Controls[0]; treeList.Refresh(); } else { Fwk.UI.Controls.Menu.ButtonBase originalButtonBase = wBarGroup.Buttons.GetBy_Guid(buttonBase_Updated.Guid); originalButtonBase.Map(buttonBase_Updated); //Recorro los items de la ActiveGroup y actuaizo los datos del que tenga como tag el guid que se actualiza foreach (NavBarItem link in this.ActiveGroup.NavBar.Items) { if (((Fwk.UI.Controls.Menu.ButtonBase)(link.Tag)).Guid.Equals(originalButtonBase.Guid)) { if (originalButtonBase.Image != null) { link.SmallImage = Fwk.HelperFunctions.TypeFunctions.ConvertByteArrayToImage(originalButtonBase.Image); } link.Caption = originalButtonBase.Caption; } } } }