public RemoteDatabaseChanges( string url, string apiKey, ICredentials credentials, HttpJsonRequestFactory jsonRequestFactory, DocumentConvention conventions, ReplicationInformer replicationInformer, Action onDispose, Func <string, Etag, string[], OperationMetadata, Task <bool> > tryResolveConflictByUsingRegisteredConflictListenersAsync) { ConnectionStatusChanged = LogOnConnectionStatusChanged; id = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); this.url = url; this.credentials = new OperationCredentials(apiKey, credentials); this.jsonRequestFactory = jsonRequestFactory; this.conventions = conventions; this.replicationInformer = replicationInformer; this.onDispose = onDispose; this.tryResolveConflictByUsingRegisteredConflictListenersAsync = tryResolveConflictByUsingRegisteredConflictListenersAsync; Task = EstablishConnection() .ObserveException() .ContinueWith(task => { task.AssertNotFailed(); return((IDatabaseChanges)this); }); }
protected RemoteChangesClientBase( string url, string apiKey, ICredentials credentials, HttpJsonRequestFactory jsonRequestFactory, TConventions conventions, Action onDispose) { // Precondition var api = this as TChangesApi; if (api == null) { throw new InvalidCastException(string.Format("The derived class does not implements {0}. Make sure the {0} interface is implemented by this class.", typeof(TChangesApi).Name)); } ConnectionStatusChanged = LogOnConnectionStatusChanged; id = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); this.url = url; this.credentials = new OperationCredentials(apiKey, credentials); this.jsonRequestFactory = jsonRequestFactory; this.onDispose = onDispose; Conventions = conventions; Task = EstablishConnection() .ObserveException() .ContinueWith(task => { task.AssertNotFailed(); return(this as TChangesApi); }); }
public RemoteDatabaseChanges(string url, ICredentials credentials, HttpJsonRequestFactory jsonRequestFactory, DocumentConvention conventions, Action onDispose) { id = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); this.url = url; this.credentials = credentials; this.jsonRequestFactory = jsonRequestFactory; this.conventions = conventions; this.onDispose = onDispose; Task = EstablishConnection() .ObserveException(); }
public RemoteDatabaseChanges(string url, ICredentials credentials, HttpJsonRequestFactory jsonRequestFactory, DocumentConvention conventions, ReplicationInformer replicationInformer, Action onDispose) { id = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); this.url = url; this.credentials = credentials; this.jsonRequestFactory = jsonRequestFactory; this.conventions = conventions; this.replicationInformer = replicationInformer; this.onDispose = onDispose; Task = EstablishConnection() .ObserveException() .ContinueWith(task => { task.AssertNotFailed(); return((IDatabaseChanges)this); }); }