Exemplo n.º 1
0
        public void Execute(OperationInfo <T> operationInfo)
        {
            var operationId        = _operationIdFactory.GetNextId();
            var operationEventArgs = new OperationEventArgs {
                OperationId = operationId
            };

            operationInfo.OnBeforeExecute(operationEventArgs);
            try {
                var result = operationInfo.Execute(operationEventArgs);
                result.OperationId = operationId;
                operationInfo.OnAfterExecute(result);
            }
            catch (Exception e) {
                Logger.LogException(e, "Error executing operation {0}", operationId);
                operationInfo.OnAfterExecute(new T {
                    OperationId = operationId,
                    Error       = e
                });
            }
        }
 private void SearchEngineOnFilesLoading(object sender, OperationEventArgs args)
 {
     _typedEventSender.SendEventAsync(new SearchEngineFilesLoading {
     OperationId = args.OperationId
       });
 }
 private void FileSystemProcessorOnSnapshotComputing(object sender, OperationEventArgs e)
 {
     _typedEventSender.SendEventAsync(new FileSystemTreeComputing {
     OperationId = e.OperationId
       });
 }
 protected virtual void OnSnapshotComputing(OperationEventArgs e)
 {
     EventHandler<OperationEventArgs> handler = SnapshotComputing;
       if (handler != null) handler(this, e);
 }