Exemple #1
0
        internal MobileServiceFileSyncContext(IMobileServiceClient client, IFileMetadataStore metadataStore, IFileOperationQueue operationsQueue,
                                              IFileSyncTriggerFactory syncTriggerFactory, IFileSyncHandler syncHandler, IMobileServiceFilesClient filesClient)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            if (metadataStore == null)
            {
                throw new ArgumentNullException("metadataStore");
            }

            if (operationsQueue == null)
            {
                throw new ArgumentNullException("operationsQueue");
            }

            if (syncTriggerFactory == null)
            {
                throw new ArgumentNullException("syncTriggerFactory");
            }

            if (syncHandler == null)
            {
                throw new ArgumentNullException("syncHandler");
            }

            this.metadataStore            = metadataStore;
            this.syncHandler              = syncHandler;
            this.operationsQueue          = operationsQueue;
            this.mobileServiceFilesClient = filesClient ?? new MobileServiceFilesClient(client, new AzureBlobStorageProvider(client));
            this.eventManager             = client.EventManager;
            this.triggers = syncTriggerFactory.CreateTriggers(this);
        }
Exemple #2
0
        public LocalStoreChangeTracker(IMobileServiceLocalStore store, StoreTrackingContext trackingContext, IMobileServiceEventManager eventManager, MobileServiceSyncSettingsManager settings)
        {
            if (store == null)
            {
                throw new ArgumentNullException("store");
            }

            if (trackingContext == null)
            {
                throw new ArgumentNullException("trackingContext");
            }

            if (eventManager == null)
            {
                throw new ArgumentNullException("eventManager");
            }

            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            this.objectReader = new MobileServiceObjectReader();

            this.store           = store;
            this.trackingContext = trackingContext;
            this.eventManager    = eventManager;
            this.settings        = settings;

            InitializeTracking();
        }
        internal MobileServiceFileSyncContext(IMobileServiceClient client, IFileMetadataStore metadataStore, IFileOperationQueue operationsQueue, 
            IFileSyncTriggerFactory syncTriggerFactory, IFileSyncHandler syncHandler, IMobileServiceFilesClient filesClient)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            if (metadataStore == null)
            {
                throw new ArgumentNullException("metadataStore");
            }

            if (operationsQueue == null)
            {
                throw new ArgumentNullException("operationsQueue");
            }

            if (syncTriggerFactory == null)
            {
                throw new ArgumentNullException("syncTriggerFactory");
            }

            if (syncHandler == null)
            {
                throw new ArgumentNullException("syncHandler");
            }

            this.metadataStore = metadataStore;
            this.syncHandler = syncHandler;
            this.operationsQueue = operationsQueue;
            this.mobileServiceFilesClient = filesClient ?? new MobileServiceFilesClient(client, new AzureBlobStorageProvider(client));
            this.eventManager = client.EventManager;
            this.triggers = syncTriggerFactory.CreateTriggers(this);
        }
        public LocalStoreChangeTracker(IMobileServiceLocalStore store, StoreTrackingContext trackingContext, IMobileServiceEventManager eventManager, MobileServiceSyncSettingsManager settings)
        {
            if (store == null)
            {
                throw new ArgumentNullException("store");
            }

            if (trackingContext == null)
            {
                throw new ArgumentNullException("trackingContext");
            }

            if (eventManager == null)
            {
                throw new ArgumentNullException("eventManager");
            }

            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            this.objectReader = new MobileServiceObjectReader();

            this.store = store;
            this.trackingContext = trackingContext;
            this.eventManager = eventManager;
            this.settings = settings;

            InitializeTracking();
        }
Exemple #5
0
        internal static IMobileServiceLocalStore CreateTrackedStore(IMobileServiceLocalStore targetStore, StoreOperationSource source, StoreTrackingOptions trackingOptions,
                                                                    IMobileServiceEventManager eventManager, MobileServiceSyncSettingsManager settings)
        {
            if (IsTrackingEnabled(trackingOptions, source))
            {
                Guid batchId = source == StoreOperationSource.Local ? Guid.Empty : Guid.NewGuid();

                return(new LocalStoreChangeTracker(targetStore, new StoreTrackingContext(source, batchId.ToString(), trackingOptions), eventManager, settings));
            }
            else
            {
                return(new LocalStoreProxy(targetStore));
            }
        }
        internal static IMobileServiceLocalStore CreateTrackedStore(IMobileServiceLocalStore targetStore, StoreOperationSource source, StoreTrackingOptions trackingOptions, 
            IMobileServiceEventManager eventManager, MobileServiceSyncSettingsManager settings)
        {
            if (IsTrackingEnabled(trackingOptions, source))
            {
                Guid batchId = source == StoreOperationSource.Local ? Guid.Empty : Guid.NewGuid();

                return new LocalStoreChangeTracker(targetStore, new StoreTrackingContext(source, batchId.ToString(), trackingOptions), eventManager, settings);
            }
            else
            {
                return new LocalStoreProxy(targetStore);               
            }
        }
        public LocalStoreChangeTracker(IMobileServiceLocalStore store, StoreTrackingContext trackingContext, IMobileServiceEventManager eventManager, MobileServiceSyncSettingsManager settings)
        {
            Arguments.IsNotNull(store, nameof(store));
            Arguments.IsNotNull(trackingContext, nameof(trackingContext));
            Arguments.IsNotNull(eventManager, nameof(eventManager));
            Arguments.IsNotNull(settings, nameof(settings));

            this.objectReader    = new MobileServiceObjectReader();
            this.store           = store;
            this.trackingContext = trackingContext;
            this.eventManager    = eventManager;
            this.settings        = settings;

            InitializeTracking();
        }
 public PurgeAction(MobileServiceTable table,
                    MobileServiceTableKind tableKind,
                    string queryId,
                    MobileServiceTableQueryDescription query,
                    bool force,
                    MobileServiceSyncContext context,
                    OperationQueue operationQueue,
                    IMobileServiceEventManager eventManager,
                    MobileServiceSyncSettingsManager settings,
                    IMobileServiceLocalStore store,
                    CancellationToken cancellationToken)
     : base(table, tableKind, queryId, query, null, context, operationQueue, settings, store, cancellationToken)
 {
     this.force        = force;
     this.eventManager = eventManager;
 }
 public PurgeAction(MobileServiceTable table,
                    MobileServiceTableKind tableKind,
                    string queryId,
                    MobileServiceTableQueryDescription query,
                    bool force,
                    MobileServiceSyncContext context,
                    OperationQueue operationQueue,
                    IMobileServiceEventManager eventManager,
                    MobileServiceSyncSettingsManager settings,
                    IMobileServiceLocalStore store,
                    CancellationToken cancellationToken)
     : base(table, tableKind, queryId, query, null, context, operationQueue, settings, store, cancellationToken)
 {
     this.force = force;
     this.eventManager = eventManager;
 }
 internal static void BackgroundPublish(this IMobileServiceEventManager manager, IMobileServiceEvent mobileServiceEvent)
 {
     manager.PublishAsync(mobileServiceEvent)
     .ContinueWith(t => t.Exception.Handle(e => true), TaskContinuationOptions.OnlyOnFaulted);
 }