using System;
namespace Tapeti.Cmd.ConsoleHelper
{
///
/// Wraps access to the console to provide cooperation between temporary outputs like the
/// progress bar and batch confirmations. Temporary outputs hide the cursor and will be
/// automatically be erased and restored when a permanent writer is called.
///
///
/// Temporary outputs are automatically supressed when the console output is redirected.
/// The Enabled property will reflect this.
///
public interface IConsole : IDisposable
{
bool Cancelled { get; }
IConsoleWriter GetPermanentWriter();
IConsoleWriter GetTemporaryWriter();
}
///
/// For simplicity outputs only support one line of text.
/// For temporary writers, each call to WriteLine will overwrite the previous and clear any
/// extra characters if the previous value was longer.
///
public interface IConsoleWriter : IDisposable
{
bool Enabled { get; }
void WriteLine(string value);
///
/// Waits for any user input.
///
void Confirm(string message);
///
/// Waits for user confirmation (Y/N).
///
bool ConfirmYesNo(string message);
}
}