using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL;
using Tango.BL.Entities;
using Tango.Integration.ExternalBridge;
using Tango.Integration.Operation;
namespace Tango.FSE.Common.Connection
{
///
/// Represents the machine connection provider.
///
public interface IMachineProvider : INotifyApplicationReady
{
///
/// Occurs when machine operator has connected.
///
event EventHandler MachineConnected;
///
/// Occurs when the machine operator has disconnected.
///
event EventHandler MachineDisconnected;
///
/// Gets the database machine entity associated with the current machine.
///
Machine Machine { get; }
///
/// Gets or sets a value indicating whether a machine is currently connected.
///
bool IsConnected { get; }
///
/// Gets the current connected machine connection type.
///
MachineConnectionTypes ConnectionType { get; }
///
/// Gets a value indicating whether the machine is connected and the equals or .
///
bool IsPPCAvailable { get; }
///
/// Gets the connection time span.
///
TimeSpan ConnectionTime { get; }
///
/// Gets a value indicating whether this instance is busy connecting/disconnecting.
///
bool IsBusy { get; }
///
/// Gets the machine operator.
///
IExternalBridgeClient MachineOperator { get; }
///
/// Connects to the specified machine.
///
/// The machine.
///
Task ConnectToMachine(IExternalBridgeClient machine);
///
/// Disconnects the current connected machine.
///
///
Task DisconnectMachine();
///
/// Disconnects the currently connected machine and displays a "waiting for reconnection dialog" with a timeout.
/// Useful when doing remote application restart.
///
/// The amount of time to wait before starting reconnection attempts.
/// The timeout for when to drop the reconnection attempt.
/// The message to display to the user
///
Task DisconnectAndWaitForReconnection(TimeSpan beginDelay, TimeSpan timeout, String message = null);
}
}