using Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp.Menu { /// /// Define a console menu with element selection. /// internal interface IMenu { /// /// True when enable, False otherwise. /// bool WriteMode { get; set; } /// /// A string input. Used for search string or entry input. /// StringBuilder InputStr { get; set; } /// /// Refresh the console with the updated display. This function dose not call Update(). /// void Display(); /// /// Update the parameters of the menu. Generally called before Display() to refresh the informations. /// void Update(); /// /// Select the next element in the selection list. /// void SelectNext(); /// /// Select the previous element in the selection list. /// void SelectPrevious(); /// /// Enable the write mode. /// void EnableWriteMode(); /// /// Disable the write mode. /// void DisableWriteMode(); /// /// Toogle the write mode. /// void ToggleWriteMode(); /// /// Define the comportement of the write mode. For instence: in the standard menu, it is used for the research of a line. /// /// The key to deal with. void WriteMenuMode(ConsoleKeyInfo cki); /// /// Execute some actions and then return. /// /// 'null' when there is no menu after this selection. Otherwise the next menu. IMenu? Return(); } }