• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IOperation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: OperationFound

 public static void OperationFound(this ILogger<CodecLogSource> logger, IOperation operation)
 {
     if (operation.GetRequestCodec() != null)
         logger.WriteInfo("Operation {0} was selected with a codec score of {1}", operation, operation.GetRequestCodec().Score);
     else
         logger.WriteInfo("Operation {0} was selected without a codec.", operation);
 }
开发者ID:dhootha,项目名称:openrasta-core,代码行数:7,代码来源:CodecLogSourceExtensions.cs


示例17: CompositeOperationBase

 protected CompositeOperationBase(IOperationResultBuilder operationResultBuilder,
     IOperation leftOperation, IOperation rightOperation)
     : base(operationResultBuilder)
 {
     this.leftOperation = leftOperation;
     this.rightOperation = rightOperation;
 }
开发者ID:chutinhha,项目名称:aiaintranet,代码行数:7,代码来源:CompositeOperationBase.cs


示例18: CreateBehaviors

        public IList<OperationBehavior> CreateBehaviors(IOperation operation, WorkflowConfiguration configuration)
        {
            if (!(operation is IConditionalOperation))
                return new OperationBehavior[0];

            return new OperationBehavior[] { new ConditionalExecutionBehavior() };
        }
开发者ID:rrl9000,项目名称:Overflow.net,代码行数:7,代码来源:ConditionalExecutionBehaviorFactory.cs


示例19: GetInterceptors

 public override IEnumerable<IOperationInterceptor> GetInterceptors(IOperation operation)
 {
     yield return DependencyManager.GetService<RequiresAuthenticationInterceptor>();
     var roleInterceptor = DependencyManager.GetService<RequiresRoleInterceptor>();
     roleInterceptor.Role = _roleName;
     yield return roleInterceptor;
 }
开发者ID:dhootha,项目名称:openrasta-core,代码行数:7,代码来源:RequiresRoleAttribute.cs


示例20: ScheduledHorizontalScaleForecastWorker

 public ScheduledHorizontalScaleForecastWorker(
     IDeployment deployment,
     IOperation operation,
     Guid subscriptionId,
     string certificateThumbprint, 
     string serviceName,
     string deploymentSlot,
     HorizontalScale[] horizontalScales,
     ScheduleDay[] scheduleDays,
     bool treatWarningsAsError,
     string mode,
     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.horizontalScales = horizontalScales;
     this.scheduleDays = scheduleDays;
     this.treatWarningsAsError = treatWarningsAsError;
     this.mode = mode;
     this.pollingIntervalInMinutes = pollingIntervalInMinutes;
 }
开发者ID:StealFocus,项目名称:Forecast,代码行数:26,代码来源:ScheduledHorizontalScaleForecastWorker.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IOperationContext类代码示例发布时间:2022-05-24
下一篇:
C# IOperand类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap