当前位置: 首页>>代码示例>>C#>>正文


C# IOperation类代码示例

本文整理汇总了C#中IOperation的典型用法代码示例。如果您正苦于以下问题:C# IOperation类的具体用法?C# IOperation怎么用?C# IOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IOperation类属于命名空间,在下文中一共展示了IOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DecorateEnumerableForExecution

 /// <summary>
 /// Add a decorator to the enumerable for additional processing
 /// </summary>
 /// <param name="operation">The operation.</param>
 /// <param name="enumerator">The enumerator.</param>
 protected override IEnumerable<Row> DecorateEnumerableForExecution(IOperation operation, IEnumerable<Row> enumerator)
 {
     foreach (Row row in new EventRaisingEnumerator(operation, enumerator))
     {
         yield return row;
     }
 }
开发者ID:smoothdeveloper,项目名称:rhino-etl,代码行数:12,代码来源:SingleThreadedNonCachedPipelineExecuter.cs

示例2: GetInterceptors

  public override IEnumerable<IOperationInterceptor> GetInterceptors(IOperation operation)
 {
     return new[]
     {
         new PrincipalAuthorizationInterceptor(DependencyManager.GetService<ICommunicationContext>())
     };
 }
开发者ID:dhootha,项目名称:openrasta-core,代码行数:7,代码来源:PrincipalAuthorizationAttribute.cs

示例3: DeploymentCreateForecastWorker

 public DeploymentCreateForecastWorker(
     IDeployment deployment,
     IOperation operation,
     Guid subscriptionId,
     string certificateThumbprint, 
     string serviceName,
     string deploymentSlot,
     ScheduleDay[] scheduleDays,
     string deploymentName,
     Uri packageUrl,
     string label,
     string configurationFilePath,
     bool startDeployment,
     bool treatWarningsAsError,
     int pollingIntervalInMinutes)
     : base(GetWorkerId(serviceName, deploymentSlot))
 {
     this.deployment = deployment;
     this.operation = operation;
     this.subscriptionId = subscriptionId;
     this.certificateThumbprint = certificateThumbprint;
     this.serviceName = serviceName;
     this.deploymentSlot = deploymentSlot;
     this.scheduleDays = scheduleDays;
     this.deploymentName = deploymentName;
     this.packageUrl = packageUrl;
     this.label = label;
     this.configurationFilePath = configurationFilePath;
     this.startDeployment = startDeployment;
     this.treatWarningsAsError = treatWarningsAsError;
     this.pollingIntervalInMinutes = pollingIntervalInMinutes;
 }
开发者ID:StealFocus,项目名称:Forecast,代码行数:32,代码来源:DeploymentCreateForecastWorker.cs

示例4: BeforeExecute

        public override bool BeforeExecute(IOperation operation)
        {
            foreach (InputMember input in operation.Inputs) {
                if (input == null)
                    continue;

                var parameter = input.Binder.BuildObject();

                try {
                    IValidator validator = ResolveValidator(parameter);
                    if (validator == null)
                        continue;

                    var errors = validator.Validate(parameter.Instance, operation.Name.ToUpper()).ToList();

                    if (errors.Count > 0) {
                        _context.OperationResult = new OperationResult.BadRequest {
                            ResponseResource = parameter.Instance,
                            Errors = errors
                        };
                        return false;
                    }
                } catch (Exception ex) {}
            }
            return true;
        }
开发者ID:gregsochanik,项目名称:RESTfulService,代码行数:26,代码来源:ValidationOperationInterceptor.cs

示例5: GetInterceptors

 public override IEnumerable<IOperationInterceptor> GetInterceptors(IOperation operation)
 {
     return new[]
     {
         new RequiresAuthenticationInterceptor(DependencyManager.GetService<ICommunicationContext>())
     };
 }
开发者ID:neilrees,项目名称:openrasta-stable,代码行数:7,代码来源:RequiresAuthenticationAttribute.cs

示例6: DoOperation

 protected virtual OperationStatus DoOperation(IOperation operation)
 {
     Logger.LogEvent(string.Format("Doing operation of type {0} syncronously.", operation.GetType().Name), this, ImportanceLevels.gUnimportant);
     var status = operation.RunSync();
     Logger.LogEvent(string.Format("Operation of type {0} is done.", operation.GetType().Name), this, ImportanceLevels.gUnimportant);
     return status;
 }
开发者ID:ZivSystems,项目名称:WcfFramework,代码行数:7,代码来源:ServiceBase.cs

示例7: clearOpInfo

 public void clearOpInfo(IOperation op)
 {
     cur_checksum.Text = "";
     app_path.Text = "";
     appName.Text = "";
     appIcon.Image = null;
 }
开发者ID:cquinlan,项目名称:USBT,代码行数:7,代码来源:Operation+Settings.cs

示例8: DecorateEnumerableForExecution

 /// <summary>
 /// Add a decorator to the enumerable for additional processing
 /// </summary>
 /// <param name="operation">The operation.</param>
 /// <param name="enumerator">The enumerator.</param>
 protected override IEnumerable<Row> DecorateEnumerableForExecution(IOperation operation, IEnumerable<Row> enumerator)
 {
     ThreadSafeEnumerator<Row> threadedEnumerator = new ThreadSafeEnumerator<Row>();
     ThreadPool.QueueUserWorkItem(delegate
     {
         try
         {
             foreach (Row t in new EventRaisingEnumerator(operation, enumerator))
             {
                 threadedEnumerator.AddItem(t);
             }
         }
         catch (Exception e)
         {
             Error(e, "Failed to execute operation {0}", operation);
             threadedEnumerator.MarkAsFinished();
             throw;
         }
         finally
         {
             threadedEnumerator.MarkAsFinished();
         }
     });
     return threadedEnumerator;
 }
开发者ID:gkinsman,项目名称:rhino-etl,代码行数:30,代码来源:ThreadPoolPipelineExecuter.cs

示例9: OperationFailed

        public void OperationFailed(IOperation operation, Exception error)
        {
            if(!OperationFailures.ContainsKey(operation))
                OperationFailures.Add(operation, new List<Exception>());

            OperationFailures[operation].Add(error);
        }
开发者ID:rrl9000,项目名称:Overflow.net,代码行数:7,代码来源:FakeWorkflowLogger.cs

示例10: WaitForResultOfRequest

        protected void WaitForResultOfRequest(ILog logger, string workerTypeName, IOperation operation, Guid subscriptionId, string certificateThumbprint, string requestId)
        {
            OperationResult operationResult = new OperationResult();
            operationResult.Status = OperationStatus.InProgress;
            bool done = false;
            while (!done)
            {
                operationResult = operation.StatusCheck(subscriptionId, certificateThumbprint, requestId);
                if (operationResult.Status == OperationStatus.InProgress)
                {
                    string logMessage = string.Format(CultureInfo.CurrentCulture, "{0} '{1}' submitted a deployment request with ID '{2}', the operation was found to be in process, waiting for '{3}' seconds.", workerTypeName, this.Id, requestId, FiveSecondsInMilliseconds / 1000);
                    logger.Info(logMessage);
                    Thread.Sleep(FiveSecondsInMilliseconds);
                }
                else
                {
                    done = true;
                }
            }

            if (operationResult.Status == OperationStatus.Failed)
            {
                string logMessage = string.Format(CultureInfo.CurrentCulture, "{0} '{1}' submitted a deployment request with ID '{2}' and it failed. The code was '{3}' and message '{4}'.", workerTypeName, this.Id, requestId, operationResult.Code, operationResult.Message);
                logger.Error(logMessage);
            }
            else if (operationResult.Status == OperationStatus.Succeeded)
            {
                string logMessage = string.Format(CultureInfo.CurrentCulture, "{0} '{1}' submitted a deployment request with ID '{2}' and it succeeded. The code was '{3}' and message '{4}'.", workerTypeName, this.Id, requestId, operationResult.Code, operationResult.Message);
                logger.Info(logMessage);
            }
        }
开发者ID:StealFocus,项目名称:Forecast,代码行数:31,代码来源:HostedServiceForecastWorker.cs

示例11: HandleOperation

        public void HandleOperation(IOperation operation)
        {
            var handlerType = typeof (IOperationHandler<>).MakeGenericType(operation.GetType());
            var handler = _handlerFactory(handlerType);

            handlerType.GetMethod("Handle").Invoke(handler, new object[] {operation});
        }
开发者ID:rioter00,项目名称:Project-Ethos,代码行数:7,代码来源:OperationService.cs

示例12: CanPassOnRemovedProcessedEvents

        public void    CanPassOnRemovedProcessedEvents()
        {
            //Arrange
            var    branching =    new    TestAbstractBranchingOperation();
            const int nOps = 5;
            var    ops    = new IOperation[nOps];
            for    (var i = 0;    i <    nOps; i++)
            {
                ops[i] = MockRepository.GenerateMock<IOperation>();
                ops[i].Expect(x    => x.OnRowProcessed    += processAction);
                ops[i].Expect(x    => x.OnRowProcessed    -= processAction);
                branching.Add(ops[i]);
            }

            //Act
            branching.OnRowProcessed +=    processAction;
            branching.OnRowProcessed -=    processAction;

            //Assert
            foreach    (var op    in ops)
                op.VerifyAllExpectations();

            var    handlerInfos = typeof(AbstractOperation).GetField("OnRowProcessed",    BindingFlags.Static    | BindingFlags.Instance    | BindingFlags.NonPublic);
            Assert.Equal(1,    ((Delegate)(handlerInfos.GetValue(branching))).GetInvocationList().Length);
        }
开发者ID:f4i2u1,项目名称:rhino-etl,代码行数:25,代码来源:BranchesEventsFixture.cs

示例13: CreateBehaviors

        public IList<OperationBehavior> CreateBehaviors(IOperation operation, WorkflowConfiguration configuration)
        {
            Verify.NotNull(operation, nameof(operation));

            var decoratorAttributes = operation.GetType().GetCustomAttributes(typeof(OperationBehaviorAttribute), inherit: false);
            return decoratorAttributes.OfType<OperationBehaviorAttribute>().Select(b => b.CreateBehavior(configuration)).ToList();
        }
开发者ID:rrl9000,项目名称:Overflow.net,代码行数:7,代码来源:OperationBehaviorAttributeFactory.cs

示例14: ResolveTouchClick

 private void ResolveTouchClick(IPuzzle puzzle, IOperation op)
 {
     IQuad quad = puzzle[op.row, op.column];
     if (quad.value == QuadValue.Front || quad.value == QuadValue.Back)
     {
         List<Tween> playings = DOTween.PlayingTweens();
         if (playings != null)
         {
             playings.ForEach((Tween each) =>
             {
                 if (each.id != null && each.id.ToString().StartsWith(Style.QuadUnifiedRotateId))
                 {
                     each.Kill(true);
                 }
             });
         }
         puzzle.touchEnable = false;
         TweenDepot depot = new TweenDepot();
         ResolvePresent(depot, puzzle, op, op, 0);
         Sequence sequence = depot.ToSequence();
         sequence.SetId(Style.QuadUnifiedRotateId);
         sequence.OnComplete(() =>
         {
             ResolveTouchData(puzzle, op);
             if (IsSolved(puzzle))
             {
                 puzzle.solved = true;
             }
             else
             {
                 puzzle.touchEnable = true;
             }
         });
     }
 }
开发者ID:SylarLi,项目名称:Puzzle1,代码行数:35,代码来源:Resolver.cs

示例15: BeforeExecute

        public override bool BeforeExecute(IOperation operation)
        {
            if ((InRoles == null || InRoles.Length == 0) && (Users == null || Users.Length == 0))
                return true;
            
            try
            {
                if (InRoles != null)
                    if (InRoles.Any(role => _context.User.IsInRole(role)))
                    {
                        return true;
                    }

                if (Users != null)
                    if (Users.Any(user => _context.User.Identity.Name == user))
                    {
                        return true;
                    }
            }
            catch
            {
                // todo: decide where to log this error.
            }

            _context.OperationResult = new OperationResult.Unauthorized();
            return false;
        }
开发者ID:dhootha,项目名称:openrasta-core,代码行数:27,代码来源:PrincipalAuthorizationAttribute.cs


注:本文中的IOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。