protected virtual IFilesChanges CreateFileSystemChanges(string filesystem) { if (string.IsNullOrEmpty(Url)) { throw new InvalidOperationException("Changes API requires usage of server/client"); } var tenantUrl = Url + "/fs/" + filesystem; var commands = fileSystemCommands.GetOrAdd(filesystem, x => (IAsyncFilesCommandsImpl)this.AsyncFilesCommands.ForFileSystem(x)); using (NoSynchronizationContext.Scope()) { var client = new FilesChangesClient(tenantUrl, ApiKey, Credentials, jsonRequestFactory, Conventions, commands.ReplicationInformer, ((AsyncFilesServerClient)this.AsyncFilesCommands).TryResolveConflictByUsingRegisteredListenersAsync, () => { fileSystemChanges.Remove(filesystem); fileSystemCommands.Remove(filesystem); }); return(client); } }
protected virtual IFilesChanges CreateFileSystemChanges(string filesystem) { if (string.IsNullOrEmpty(Url)) throw new InvalidOperationException("Changes API requires usage of server/client"); var tenantUrl = Url + "/fs/" + filesystem; var commands = fileSystemCommands.GetOrAdd(filesystem, x => (IAsyncFilesCommandsImpl)this.AsyncFilesCommands.ForFileSystem(x)); using (NoSynchronizationContext.Scope()) { var client = new FilesChangesClient(tenantUrl, ApiKey, Credentials, jsonRequestFactory, Conventions, commands.ReplicationInformer, ((AsyncFilesServerClient) this.AsyncFilesCommands).TryResolveConflictByUsingRegisteredListenersAsync, () => { fileSystemChanges.Remove(filesystem); fileSystemCommands.Remove(filesystem); }); return client; } }