Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Main main = new Main();
- class Main
- {
- private bool _isWorking = true;
- public Main()
- {
- Start();
- }
- private void Menu()
- {
- while (_isWorking == false)
- {
- Console.WriteLine("1.Начать");
- string userInput = Console.ReadLine();
- if (userInput == "1")
- {
- _isWorking = true;
- Start();
- }
- }
- }
- private async Task Start()
- {
- Task.Run(() => Write());
- while (_isWorking)
- {
- string userInput = Console.ReadLine();
- if (userInput == "1")
- {
- _isWorking = false;
- }
- }
- Menu();
- }
- private async Task Write()
- {
- while (_isWorking)
- {
- Console.WriteLine("1.Действие");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment