private void showApplicationMenu(AubitDesktop.Xml.StartMenu sMenu, int applicationLauncherId) { applicationLauncherTreeView.Nodes.Clear(); TreeNode root = new TreeNode(sMenu.text); hasApplicationTree = true; showOrHideApplicationLauncher(); applicationLauncherTreeView.Nodes.Add(root); foreach (AubitDesktop.Xml.StartMenuGroup n in sMenu.StartMenuGroup) { addTreeNodes(root, n); } root.Expand(); this.applicationLauncherId = applicationLauncherId; }
public void loadApplicationLauncherTree(string XMLFile, int applicationLauncherId) { AubitDesktop.Xml.StartMenu sMenu = null; System.IO.StreamReader file = null; System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(AubitDesktop.Xml.StartMenu)); try { file = new System.IO.StreamReader(XMLFile); } catch (Exception e) { Program.Show(e.ToString(), "Error getting XML application launcher file"); return; } try { // Deserialize the content of the file into the settings... sMenu = (AubitDesktop.Xml.StartMenu)reader.Deserialize(file); file.Close(); } catch (Exception e) { Program.Show(e.ToString(), "Unable to load Menu"); } if (sMenu != null) { showApplicationMenu(sMenu, applicationLauncherId); } else { hasApplicationTree = false; showOrHideApplicationLauncher(); } }