private static MenusConfig GetMenusConfig(Profile profileXmlObject) { var menusXmlObject = profileXmlObject.Menus; var menuList = new List<MenuConfig>(); foreach (var menuXmlObject in menusXmlObject.Menu) { var menuItems = new List<CmdConfig>(); foreach (var cmdXmlObject in menuXmlObject.Cmd) { var commandText = cmdXmlObject.GetTextLines(cmdXmlObject.Trim, cmdXmlObject.Flatten, cmdXmlObject.Join); menuItems.Add(new CmdConfig(cmdXmlObject.Title, commandText, cmdXmlObject.EchoOff, cmdXmlObject.Pause)); } menuList.Add(new MenuConfig(menuXmlObject.Title, menuItems)); } return new MenusConfig(menuList); }
/// <exception cref="ConfigurationErrorsException"></exception> private PathDirsConfig GetPathDirsConfig(Profile profileXmlObject) { var pathDirsXmlObject = profileXmlObject.PathDirs; var pathDirsIncludeFilePath = GetFullPath(pathDirsXmlObject.Include); if (!File.Exists(pathDirsIncludeFilePath)) throw new ConfigurationErrorsException(String.Format( "{0} - PathDirs Include path not found {1}", ProfileFilePath, pathDirsIncludeFilePath)); return new PathDirsConfig(pathDirsIncludeFilePath, pathDirsXmlObject.Append); }