예제 #1
0
        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);
        }
예제 #2
0
 public static void SaveMenuToFile(String pFullFileName, RootMenu pMenuItemRoot)
 {
     if (String.IsNullOrEmpty(pFullFileName))
     {
         return;
     }
     Fwk.HelperFunctions.FileFunctions.SaveTextFile(pFullFileName, pMenuItemRoot.GetXml(), false);
 }
예제 #3
0
        private void newToolStripButton_Click(object sender, EventArgs e)
        {
            _RootMenu = new RootMenu();
            _RootMenu.MenuItem.DisplayName = "Root element";
            _CurrentFullFileName           = Helper.NewFile(_RootMenu);

            LoadMenuFile();
        }
예제 #4
0
        public static RootMenu LoadMenuFromFile(String pFullFileName)
        {
            if (String.IsNullOrEmpty(pFullFileName))
            {
                return(null);
            }

            String xml = Fwk.HelperFunctions.FileFunctions.OpenTextFile(pFullFileName);

            return(RootMenu.GetRootMenuFromXml(xml));
        }
예제 #5
0
 /// <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);
     }
 }