private void IndexDocumentDirectory(Entities.DocumentDirectory documentDirectory)
 {
     ProgressViewer.Display(_cancellationTokenIssuer, actions: (token, progress) => {
         _mediator.CommandAsync(new IndexDocumentDirectoryCommand {
             DocumentDirectoryID = documentDirectory.DocumentDirectoryID
         }, token, progress).Wait();
     });
 }
        private void SaveDocumentDirectory(CancellationToken cancellationToken, IProgress <ProgressInfo> progress)
        {
            var command = new SaveDocumentDirectoryCommand {
                DocumentDirectoryID = ViewModel.DocumentDirectoryID,
                Code     = ViewModel.Code,
                Label    = ViewModel.Label,
                Path     = ViewModel.Path,
                Position = ViewModel.Position
            };

            _mediator.CommandAsync(command, cancellationToken, progress).Wait();

            ViewModel.DocumentDirectoryID = command.DocumentDirectoryID;
        }
        public static void Command(this IMediator source, ICommand command, IProgress <ProgressInfo> progress = null)
        {
            if (source == null)
            {
                return;
            }

            source.CommandAsync(command, CancellationToken.None, progress).Wait();
        }