|
|
@ -7,6 +7,7 @@ using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using ConsoleApp.Menu.Core;
|
|
|
|
using ConsoleApp.Menu.Core;
|
|
|
|
|
|
|
|
using Model.Managers;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ConsoleApp
|
|
|
|
namespace ConsoleApp
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -19,7 +20,7 @@ namespace ConsoleApp
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// The manager that contains usefull data taken from the model.
|
|
|
|
/// The manager that contains usefull data taken from the model.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public DataManager DataManager { get; private set; }
|
|
|
|
public MasterManager MasterMgr { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Each menu called are push in this stack. Then, to return back, we pop this stack to retrive the previous menu.
|
|
|
|
/// Each menu called are push in this stack. Then, to return back, we pop this stack to retrive the previous menu.
|
|
|
@ -31,11 +32,11 @@ namespace ConsoleApp
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Constructor of the MenuManager class. This constructor allows you to give the first menu of the call stack, wich is usefull for testing.
|
|
|
|
/// Constructor of the MenuManager class. This constructor allows you to give the first menu of the call stack, wich is usefull for testing.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="dataManager">The data manager needed by the menus inside.</param>
|
|
|
|
/// <param name="masterManager">The data manager needed by the menus inside.</param>
|
|
|
|
/// <param name="firstMenu">The starting menu, the first that will be push on the call stack.</param>
|
|
|
|
/// <param name="firstMenu">The starting menu, the first that will be push on the call stack.</param>
|
|
|
|
public MenuManager(DataManager dataManager, IMenu firstMenu)
|
|
|
|
public MenuManager(MasterManager masterManager, IMenu firstMenu)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DataManager = dataManager;
|
|
|
|
MasterMgr = masterManager;
|
|
|
|
|
|
|
|
|
|
|
|
MenuCallStack = new Stack<IMenu>();
|
|
|
|
MenuCallStack = new Stack<IMenu>();
|
|
|
|
MenuCallStack.Push(firstMenu);
|
|
|
|
MenuCallStack.Push(firstMenu);
|
|
|
@ -44,8 +45,8 @@ namespace ConsoleApp
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Constructor of the MenuManager class.
|
|
|
|
/// Constructor of the MenuManager class.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="dataManager">The data manager needed by the menus inside.</param>
|
|
|
|
/// <param name="masterManager">The data manager needed by the menus inside.</param>
|
|
|
|
public MenuManager(DataManager dataManager) : this(dataManager, new MainMenu(dataManager))
|
|
|
|
public MenuManager(MasterManager masterManager) : this(masterManager, new MainMenu(masterManager))
|
|
|
|
{ }
|
|
|
|
{ }
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|