コード例 #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
                });
            }
        }
コード例 #2
0
 private void SearchEngineOnFilesLoading(object sender, OperationEventArgs args)
 {
     _typedEventSender.SendEventAsync(new SearchEngineFilesLoading {
     OperationId = args.OperationId
       });
 }
コード例 #3
0
 private void FileSystemProcessorOnSnapshotComputing(object sender, OperationEventArgs e)
 {
     _typedEventSender.SendEventAsync(new FileSystemTreeComputing {
     OperationId = e.OperationId
       });
 }
コード例 #4
0
 protected virtual void OnSnapshotComputing(OperationEventArgs e)
 {
     EventHandler<OperationEventArgs> handler = SnapshotComputing;
       if (handler != null) handler(this, e);
 }