private void showTimeMenuItem_Select(OperationMenuItem i_CurrentOperation) { Console.Clear(); string timeToPrint = DateTime.Now.ToShortTimeString(); Console.WriteLine(timeToPrint); Show(); }
private List <MenuItem> createActionsMenusItems() { List <MenuItem> listOfMenus = new List <MenuItem>(); OperationMenuItem countSpaces = new OperationMenuItem(k_CountSpacesMenuName); countSpaces.Selected += countSpacesMenuItem_Select; listOfMenus.Add(countSpaces); OperationMenuItem charCount = new OperationMenuItem(k_CharCountMenuName); charCount.Selected += charCountMenuItem_Select; listOfMenus.Add(charCount); return(listOfMenus); }
private List <MenuItem> createActionsAndInfoMenusItems() { List <MenuItem> listOfMenus = new List <MenuItem>(); OperationMenuItem displayMenuItem = new OperationMenuItem(k_DisplayVersionMenuName); displayMenuItem.Selected += showVersionMenuItem_Select; listOfMenus.Add(displayMenuItem); List <MenuItem> actionsMenusItems = createActionsMenusItems(); MainMenu actions = new MainMenu(k_ActionsMenuName, actionsMenusItems); listOfMenus.Add(actions); return(listOfMenus); }
private List <MenuItem> createDateAndTimeMenusItems() { List <MenuItem> listOfMenus = new List <MenuItem>(); OperationMenuItem showDateMenuItem = new OperationMenuItem(k_ShowDateMenuName); showDateMenuItem.Selected += showDateMenuItem_Select; listOfMenus.Add(showDateMenuItem); OperationMenuItem showTimeMenuItem = new OperationMenuItem(k_ShowTimeMenuName); showTimeMenuItem.Selected += showTimeMenuItem_Select; listOfMenus.Add(showTimeMenuItem); return(listOfMenus); }
private List <MenuItem> createActionsMenusItems() { List <MenuItem> listOfMenus = new List <MenuItem>(); OperationMenuItem countSpaces = new OperationMenuItem(k_CountSpacesMenuName); countSpaces.ActionListener = this; listOfMenus.Add(countSpaces); OperationMenuItem charCount = new OperationMenuItem(k_CharCountMenuName); charCount.ActionListener = this; listOfMenus.Add(charCount); return(listOfMenus); }
private List <MenuItem> createDateAndTimeMenusItems() { List <MenuItem> listOfMenus = new List <MenuItem>(); OperationMenuItem showDateMenuItem = new OperationMenuItem(k_ShowDateMenuName); showDateMenuItem.ActionListener = this; listOfMenus.Add(showDateMenuItem); OperationMenuItem showTimeMenuItem = new OperationMenuItem(k_ShowTimeMenuName); showTimeMenuItem.ActionListener = this; listOfMenus.Add(showTimeMenuItem); return(listOfMenus); }
private void charCountMenuItem_Select(OperationMenuItem i_CurrentOperation) { Console.Clear(); Console.WriteLine("Please enter a sentence"); string sentence = Console.ReadLine(); int counterOfLetters = 0; foreach (char character in sentence) { if (char.IsLetter(character)) { counterOfLetters++; } } Console.WriteLine(string.Format("There is {0} letters in the string.", counterOfLetters)); Show(); }
private void showVersionMenuItem_Select(OperationMenuItem i_CurrentOperation) { Console.Clear(); Console.WriteLine(k_AppVersion); Show(); }