Exemplo n.º 1
0
 /// <summary>
 /// An implementation for <see cref="Amazon.CognitoSync.SyncManager.ILocalStorage"/>
 /// using <see href="http://sqlite.org">SQLite</see>
 /// </summary>
 public SQLiteLocalStorage()
 {
     _logger       = Logger.GetLogger(this.GetType());
     directoryPath = AmazonHookedPlatformInfo.Instance.PersistentDataPath;
     filePath      = System.IO.Path.Combine(directoryPath, DB_FILE_NAME);
     this.SetupDatabase();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates an instance of CognitoSyncManager using cognito credentials and a configuration object
        /// <code>
        /// CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials,new AmazonCognitoSyncConfig { RegionEndpoint =  RegionEndpoint.USEAST1})
        /// </code>
        /// </summary>
        /// <param name="cognitoCredentials"><see cref="Amazon.CognitoIdentity.CognitoAWSCredentials"/></param>
        /// <param name="config"><see cref="Amazon.CognitoSync.AmazonCognitoSyncConfig"/></param>
        /// <seealso href="http://docs.aws.amazon.com/cognito/latest/developerguide/synchronizing-data.html#initializing-client">Amazon Cognito Sync Dev. Guide - Initializing Client</seealso>
        public CognitoSyncManager(CognitoAWSCredentials cognitoCredentials, AmazonCognitoSyncConfig config)
        {
            if (cognitoCredentials == null)
            {
                throw new ArgumentNullException("cognitoCredentials");
            }

#if BCL
            ValidateParameters();
#endif

            this.CognitoCredentials = cognitoCredentials;
            Local  = new SQLiteLocalStorage();
            Remote = new CognitoSyncStorage(CognitoCredentials, config);

            cognitoCredentials.IdentityChangedEvent += this.IdentityChanged;

            _logger = Logger.GetLogger(this.GetType());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates an instance of CognitoSyncManager using cognito credentials and a configuration object
        /// <code>
        /// CognitoSyncManager cognitoSyncManager = new CognitoSyncManager(credentials,new AmazonCognitoSyncConfig { RegionEndpoint =  RegionEndpoint.USEAST1})
        /// </code>
        /// </summary>
        /// <param name="cognitoCredentials"><see cref="Amazon.CognitoIdentity.CognitoAWSCredentials"/></param>
        /// <param name="config"><see cref="Amazon.CognitoSync.AmazonCognitoSyncConfig"/></param>
        public CognitoSyncManager(CognitoAWSCredentials cognitoCredentials, AmazonCognitoSyncConfig config)
        {
            if (cognitoCredentials == null)
            {
                throw new ArgumentNullException("cognitoCredentials");
            }

#if BCL
            ValidateParameters();
#endif

            this.CognitoCredentials = cognitoCredentials;
            Local = new SQLiteLocalStorage();
            Remote = new CognitoSyncStorage(CognitoCredentials, config);

            cognitoCredentials.IdentityChangedEvent += this.IdentityChanged;

            _logger = Logger.GetLogger(this.GetType());
        }