mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-16 15:16:34 +01:00
29 lines
1,016 B
C#
29 lines
1,016 B
C#
using System;
|
|
using TINK.Repository;
|
|
|
|
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. If offline cache connector is returned.</param>
|
|
/// <param name="appContextInfo">Provides app related info (app name and version, merchantid) to pass to COPRI.</param>
|
|
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
|
|
/// <returns></returns>
|
|
public static IConnector Create(
|
|
bool isConnected,
|
|
Uri activeUri,
|
|
AppContextInfo appContextInfo,
|
|
string uiIsoLangugageName,
|
|
string sessionCookie,
|
|
string mail,
|
|
TimeSpan? expiresAfter = null)
|
|
{
|
|
return isConnected
|
|
? new Connector(activeUri, appContextInfo, uiIsoLangugageName, sessionCookie, mail, expiresAfter: expiresAfter) as IConnector
|
|
: new ConnectorCache(appContextInfo, uiIsoLangugageName, sessionCookie, mail);
|
|
}
|
|
}
|
|
}
|