示例#1
0
        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;
            }
        }
示例#2
0
 public RemoteFileBulkProcessCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject, List <WebSocketPackage> packages)
     : base(repository, connection, accountObject)
 {
     Packages = packages;
 }
示例#3
0
 protected FileCommandConnectionBase(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
     : base(repository, accountObject)
 {
     Connection = connection;
 }
示例#4
0
 protected LocalFileBulkCommandBase(IFileRepository repository, List <FileSystemEventArgs> fileSystemEventArgs, SynchronizationObject accountObject)
     : base(repository, accountObject)
 {
     FileSystemEventArgs = fileSystemEventArgs;
 }
示例#5
0
 internal RemoteFileScanObjectCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject, WebSocketPackage webSocketPackage)
     : base(repository, connection, accountObject)
 {
     _webSocketPackage = webSocketPackage;
 }
示例#6
0
 public RemoteFileScanObjectCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
     : base(repository, connection, accountObject)
 {
 }
示例#7
0
 public LocalFileBulkRenamedCommand(IFileRepository repository, List <FileSystemEventArgs> fileSystemEventArgs, SynchronizationObject accountObject)
     : base(repository, fileSystemEventArgs, accountObject)
 {
 }
示例#8
0
 protected FileCommandBase(IFileRepository repository, SynchronizationObject accountObject)
 {
     FileRepository = repository;
     AccountObject  = accountObject;
 }
示例#9
0
 public TransferAggregationCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
     : base(repository, connection, accountObject)
 {
 }
示例#10
0
 public ResolveConflictFilesCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
     : base(repository, connection, accountObject)
 {
 }
示例#11
0
 public LocalFilesConflictsConfirmationCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
     : base(repository, connection, accountObject)
 {
 }
示例#12
0
 public RemoteDuplicatesRenameCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
     : base(repository, connection, accountObject)
 {
 }
示例#13
0
        private const long TooBigSize = 100 * 1024 * 1024; //100 megabytes

        public DownloadFilesCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
            : base(repository, connection, accountObject)
        {
        }
示例#14
0
 public static SynchronizationToken Create(SynchronizationObject synchronizationObject, string ownerId) =>
 new SynchronizationToken(synchronizationObject, ownerId);
示例#15
0
 public MoveRenameFileCommand(IFileRepository repository, IConnection connection, SynchronizationObject accountObject)
     : base(repository, connection, accountObject)
 {
 }
示例#16
0
 public FileCommandActionWrapper(IFileRepository repository, SynchronizationObject accountObject, Action callback)
     : base(repository, accountObject)
 {
     _callback = callback;
 }