mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-24 08:06:28 +01:00
20 lines
720 B
C#
20 lines
720 B
C#
|
using System;
|
|||
|
|
|||
|
namespace TINK.Model.Connector
|
|||
|
{
|
|||
|
public class ConnectorFactory
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Gets a connector object depending on whether beein onlin or offline.
|
|||
|
/// </summary>
|
|||
|
/// <param name="isConnected">True if online, false if offline</param>
|
|||
|
/// <returns></returns>
|
|||
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|