private SynchronizationToken(SynchronizationObject synchronizationObject, string ownerId) { if (synchronizationObject != null) { if (!synchronizationObject.ServiceId.HasValue) { throw new ArgumentException($"Synchronization object is free. SynchronizationObject.Id = '{synchronizationObject.Id}'"); } var owner = synchronizationObject.Owners.SingleOrDefault(oo => oo.OwnerId == ownerId && oo.IsActive); if (owner == null) { throw new InvalidOperationException($"Synchronization object owner not found. SynchronizationObject.Id = '{synchronizationObject.Id}', Owner.Id = '{ownerId}'"); } Object = SynchronizationObjectToken.Create(synchronizationObject.Id, synchronizationObject.ServiceId.Value); Owner = SynchronizationObjectOwnerToken.Create(owner.Id, owner.OwnerId); } else { Object = SynchronizationObjectToken.Empty; Owner = SynchronizationObjectOwnerToken.Empty; } }
public RemoteFileBulkProcessCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject, List <WebSocketPackage> packages) : base(repository, connection, accountObject) { Packages = packages; }
protected FileCommandConnectionBase(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, accountObject) { Connection = connection; }
protected LocalFileBulkCommandBase(IFileRepository repository, List <FileSystemEventArgs> fileSystemEventArgs, SynchronizationObject accountObject) : base(repository, accountObject) { FileSystemEventArgs = fileSystemEventArgs; }
internal RemoteFileScanObjectCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject, WebSocketPackage webSocketPackage) : base(repository, connection, accountObject) { _webSocketPackage = webSocketPackage; }
public RemoteFileScanObjectCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, connection, accountObject) { }
public LocalFileBulkRenamedCommand(IFileRepository repository, List <FileSystemEventArgs> fileSystemEventArgs, SynchronizationObject accountObject) : base(repository, fileSystemEventArgs, accountObject) { }
protected FileCommandBase(IFileRepository repository, SynchronizationObject accountObject) { FileRepository = repository; AccountObject = accountObject; }
public TransferAggregationCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, connection, accountObject) { }
public ResolveConflictFilesCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, connection, accountObject) { }
public LocalFilesConflictsConfirmationCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, connection, accountObject) { }
public RemoteDuplicatesRenameCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, connection, accountObject) { }
private const long TooBigSize = 100 * 1024 * 1024; //100 megabytes public DownloadFilesCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, connection, accountObject) { }
public static SynchronizationToken Create(SynchronizationObject synchronizationObject, string ownerId) => new SynchronizationToken(synchronizationObject, ownerId);
public MoveRenameFileCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject) : base(repository, connection, accountObject) { }
public FileCommandActionWrapper(IFileRepository repository, SynchronizationObject accountObject, Action callback) : base(repository, accountObject) { _callback = callback; }