Exemple #1
0
        public PSLocalTask <RemoveSyncRequest, object> CreateRemoveSyncRequestTask(ExchangePrincipal executingUser)
        {
            RemoveSyncRequest task = new RemoveSyncRequest();

            this.InitializeTaskToExecuteInMode(executingUser, task, "Remove-SyncRequest", "Identity");
            return(new PSLocalTask <RemoveSyncRequest, object>(task));
        }
Exemple #2
0
        private static int Remove(RemoveOptions removeOptions, Service.InSync.InSyncClient client)
        {
            var request = new RemoveSyncRequest
            {
                SourcePath = removeOptions.SourceFolder ?? string.Empty,
                TargetPath = removeOptions.TargetFolder ?? string.Empty
            };

            var result = client.RemoveSync(request);

            result.Removed
            .ToList()
            .ForEach(x => Console.WriteLine($"{x.SourcePath} => {x.TargetPath} (removed)"));
            return(0);
        }
Exemple #3
0
        public override async Task <RemoveSyncResponse> RemoveSync(RemoveSyncRequest request, ServerCallContext context)
        {
            using var unitOfWork = _unitOfWorkFactory.Create();
            var watches = await _syncService.DeleteWatchesAsync(unitOfWork, request.SourcePath, request.TargetPath);

            await unitOfWork.CommitAsync();

            return(new RemoveSyncResponse
            {
                Result = ErrorCode.Ok,
                Removed =
                {
                    watches.Select(x => new Sync
                    {
                        SourcePath = x.SourcePath,
                        TargetPath = x.TargetPath
                    })
                }
            });
        }