using System;
namespace TINK.Model.Connector
{
public class ConnectorFactory
{
///
/// Gets a connector object depending on whether beein onlin or offline.
///
/// True if online, false if offline
///
public static IConnector Create(bool isConnected, Uri activeUri, string userAgent, string sessionCookie, string mail, TimeSpan? expiresAfter = null)
{
return isConnected
? new Connector(activeUri, userAgent, sessionCookie, mail, expiresAfter: expiresAfter) as IConnector
: new ConnectorCache(sessionCookie, mail);
}
}
}