public static void Load(System.Windows.Forms.TreeView pTreeView, RootMenu pMenuItemRoot) { TreeNode wTreeNodeRoot = pTreeView.Nodes.Add(pMenuItemRoot.MenuItem.DisplayName); wTreeNodeRoot.Tag = pMenuItemRoot.MenuItem; LoadRecursive(wTreeNodeRoot, pMenuItemRoot.MenuItem.MenuItemList); }
public static void SaveMenuToFile(String pFullFileName, RootMenu pMenuItemRoot) { if (String.IsNullOrEmpty(pFullFileName)) { return; } Fwk.HelperFunctions.FileFunctions.SaveTextFile(pFullFileName, pMenuItemRoot.GetXml(), false); }
private void newToolStripButton_Click(object sender, EventArgs e) { _RootMenu = new RootMenu(); _RootMenu.MenuItem.DisplayName = "Root element"; _CurrentFullFileName = Helper.NewFile(_RootMenu); LoadMenuFile(); }
public static RootMenu LoadMenuFromFile(String pFullFileName) { if (String.IsNullOrEmpty(pFullFileName)) { return(null); } String xml = Fwk.HelperFunctions.FileFunctions.OpenTextFile(pFullFileName); return(RootMenu.GetRootMenuFromXml(xml)); }
/// <summary> /// /// </summary> void LoadMenuFile() { if (String.IsNullOrEmpty(_CurrentFullFileName)) { return; } try { _RootMenu = TreeViewEngine.LoadMenuFromFile(_CurrentFullFileName); TreeViewEngine.Load(this.treeViewDesingner, _RootMenu); lblFileLoad.Text = String.Concat("File ", _CurrentFullFileName); } catch (InvalidOperationException) { fwkMessageView_Error.Show("The file not contain correct format to represent any menu .-"); } catch (Exception ex2) { fwkMessageView_Error.Show(ex2); } }