public override ConsoleMenuReport Execute()
 {
     Console.WriteLine("Enter new string: \n");
     line = Console.ReadLine();
     externalObject.SomeString = line;
     return(new ConsoleMenuReport(externalObject.ToString(), "String value has been changed.", this.ToString(), Request.WithoutInterruption)); // this time user doesn't see confirmation
 }
 public override ConsoleMenuReport Execute()
 {
     Console.WriteLine("Enter new number: \n");
     line = Console.ReadLine();
     externalObject.SomeInt = Convert.ToInt32(line);
     return(new ConsoleMenuReport(externalObject.ToString(), "Int value has been changed.", this.ToString(), Request.Suspend));
 }
        public override ConsoleMenuReport Execute()
        {
            ExternalObject externalObject = new ExternalObject()
            {
                SomeInt = 50, SomeString = "Initial string"
            };

            ConsoleMenuOperation[] menuOperations = new ConsoleMenuOperation[3]
            {
                new SubProgram2.Operation_ChangeObjectsInt(externalObject),
                new SubProgram2.Operation_ChangeObjectsString(externalObject),
                new SubProgram2.Operation_CloseSubProgram2()
            };
            ConsoleMenu subMenu2 = new ConsoleMenu("Sub Program 2:", menuOperations, externalObject.ToString());

            subMenu2.Run();
            return(new ConsoleMenuReport("Sub program 2 has been closed.", this.ToString(), Request.Suspend));
        }