示例#1
0
        public static void Show(ContactBook book)
        {
            while (true)
            {
                PromptE.Menu("[UVV Contacts] Pick an option")
                .Action(new AddContactButton(book))
                .Action("List contacts", () => ContactsMenu.Show(book))
                .Action(new ExitApplicationAction())
                .Show();
            }

            // ReSharper disable once FunctionNeverReturns
        }
示例#2
0
        public static void Show(ContactBook book)
        {
            var contact = ContactSelectorMenu.Show(book);

            if (contact == null)
            {
                return;
            }

            PromptE.Menu($"[name: {contact.DisplayName} | email: {contact.Email} | cell: {contact.CellphoneNumber}]")
            .Action(new UpdateContactAction(book, contact))
            .Action("Delete", () => book.Remove(contact))
            .Action("[Cancel]", null)
            .Show();
        }