private Menu BulidFileMenu() { List<MenuItem> menuItems = new List<MenuItem>(); Menu fileMenu = new Menu("File", 1, 2, "fileMenu", this); var newMenuItem = new MenuItem("New", "fileMenuMenuItemNew", fileMenu.MenuDropdown); newMenuItem.Action = delegate() { NewFile(newMenuItem.ParentWindow); }; menuItems.Add(newMenuItem); var loadMenuItem = new MenuItem("Load", "fileMenuMenuItemLoad", fileMenu.MenuDropdown); loadMenuItem.Action = delegate() { LoadData(loadMenuItem.ParentWindow); }; menuItems.Add(loadMenuItem); var saveMenuItem = new MenuItem("Save", "fileMenuMenuItemSave", fileMenu.MenuDropdown); saveMenuItem.Action = delegate() { SaveData(saveMenuItem.ParentWindow); }; menuItems.Add(saveMenuItem); var exitMenuItem = new MenuItem("Exit", "fileMenuMenuItemExit", fileMenu.MenuDropdown); exitMenuItem.Action = delegate() { ExitApp(saveMenuItem.ParentWindow); }; menuItems.Add(exitMenuItem); fileMenu.MenuItems.AddRange(menuItems); return fileMenu; }
private Menu BulidHelpMenu() { List<MenuItem> menuItems = new List<MenuItem>(); Menu helpMenu = new Menu("Help", 1, 22, "helpMenu", this); var viewHelpMenuItem = new MenuItem("Help", "fileMenuMenuItemViewHelp", fileMenu.MenuDropdown); viewHelpMenuItem.Action = delegate() { new Alert("Coming Soon!", viewHelpMenuItem.ParentWindow); }; menuItems.Add(viewHelpMenuItem); var aboutMenuItem = new MenuItem("About", "fileMenuMenuItemAbout", fileMenu.MenuDropdown); aboutMenuItem.Action = delegate() { new Alert("Does anyone ever read this?", viewHelpMenuItem.ParentWindow); }; menuItems.Add(aboutMenuItem); helpMenu.MenuItems.AddRange(menuItems); return helpMenu; }
private Menu BuildSettingMenu() { List<MenuItem> menuItems = new List<MenuItem>(); Menu settingMenu = new Menu("Settings", 1, 10, "settingMenu", this); var resolutionMenuItem = new MenuItem("Set Resolution", "settingMenuMenuItemResolution", fileMenu.MenuDropdown); resolutionMenuItem.Action = delegate() { new Resolution(resolutionMenuItem.ParentWindow); fileLabel.Ypostion = (Console.WindowWidth / 2) - (FileInfo.Filename.Count() + 2); Draw(); }; menuItems.Add(resolutionMenuItem); settingMenu.MenuItems.AddRange(menuItems); return settingMenu; }