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


C# NativeActivityMetadata.AddValidationError方法代码示例

本文整理汇总了C#中NativeActivityMetadata.AddValidationError方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityMetadata.AddValidationError方法的具体用法?C# NativeActivityMetadata.AddValidationError怎么用?C# NativeActivityMetadata.AddValidationError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NativeActivityMetadata的用法示例。


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

示例1: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            if (GetBatchingStrategyFactory.IsNull()) metadata.AddValidationError("GetBatchingStrategyFactory function is expected.");
            if (GetNextVectors.IsNull()) metadata.AddValidationError("GetNextVectors function is expected.");
            if (ItemCount == null) metadata.AddValidationError("ItemCount expression expected.");

            metadata.AddDelegate(GetBatchingStrategyFactory);
            metadata.AddDelegate(GetNextVectors);
            metadata.AddDelegate(ReinitializeVectorProvider);

            RuntimeArgument arg;

            metadata.AddArgument(arg = new RuntimeArgument("LastResult", typeof(BatchExecutionResult), ArgumentDirection.In));
            metadata.Bind(LastResult, arg);

            metadata.AddArgument(arg = new RuntimeArgument("ReinitializationFrequency", typeof(int), ArgumentDirection.In));
            metadata.Bind(ReinitializationFrequency, arg);

            metadata.AddArgument(arg = new RuntimeArgument("UseCache", typeof(bool), ArgumentDirection.In));
            metadata.Bind(UseCache, arg);

            metadata.AddChild(ItemCount);

            metadata.AddImplementationVariable(cachedVectors);
            metadata.AddImplementationVariable(strategyHasJustInited);

            base.CacheMetadata(metadata);
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:28,代码来源:UnorderedBatcher.cs

示例2: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            base.CacheMetadata(metadata);

            if (Body.IsNull()) metadata.AddValidationError("Body is required.");

            metadata.AddDelegate(Body);

            if (Condition == null) metadata.AddValidationError("Condition is required.");

            metadata.AddChild(Condition);
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:12,代码来源:TrainingLoop.cs

示例3: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
     foreach (KeyValuePair<string, Argument> pair in this.DelegateArguments)
     {
         RuntimeArgument argument = new RuntimeArgument(pair.Key, pair.Value.ArgumentType, pair.Value.Direction);
         metadata.Bind(pair.Value, argument);
         arguments.Add(argument);
     }
     metadata.SetArgumentsCollection(arguments);
     metadata.AddDelegate(this.Delegate);
     if (this.Delegate != null)
     {
         IList<RuntimeDelegateArgument> runtimeDelegateArguments = this.Delegate.RuntimeDelegateArguments;
         if (this.DelegateArguments.Count != runtimeDelegateArguments.Count)
         {
             metadata.AddValidationError(System.Activities.SR.WrongNumberOfArgumentsForActivityDelegate);
         }
         for (int i = 0; i < runtimeDelegateArguments.Count; i++)
         {
             RuntimeDelegateArgument argument2 = runtimeDelegateArguments[i];
             Argument argument3 = null;
             string name = argument2.Name;
             if (this.DelegateArguments.TryGetValue(name, out argument3))
             {
                 if (argument3.Direction != argument2.Direction)
                 {
                     metadata.AddValidationError(System.Activities.SR.DelegateParameterDirectionalityMismatch(name, argument3.Direction, argument2.Direction));
                 }
                 if (argument2.Direction == ArgumentDirection.In)
                 {
                     if (!TypeHelper.AreTypesCompatible(argument3.ArgumentType, argument2.Type))
                     {
                         metadata.AddValidationError(System.Activities.SR.DelegateInArgumentTypeMismatch(name, argument2.Type, argument3.ArgumentType));
                     }
                 }
                 else if (!TypeHelper.AreTypesCompatible(argument2.Type, argument3.ArgumentType))
                 {
                     metadata.AddValidationError(System.Activities.SR.DelegateOutArgumentTypeMismatch(name, argument2.Type, argument3.ArgumentType));
                 }
             }
             else
             {
                 metadata.AddValidationError(System.Activities.SR.InputParametersMissing(argument2.Name));
             }
             if (!this.hasOutputArguments && ArgumentDirectionHelper.IsOut(argument2.Direction))
             {
                 this.hasOutputArguments = true;
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:52,代码来源:InvokeDelegate.cs

示例4: OnOpen

 internal override void OnOpen(Flowchart owner, NativeActivityMetadata metadata)
 {
     if (this.Condition == null)
     {
         metadata.AddValidationError(System.Activities.SR.FlowDecisionRequiresCondition(owner.DisplayName));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:FlowDecision.cs

示例5: Open

        // Returns true if this is the first time we've visited this node during this pass
        internal bool Open(Flowchart owner, NativeActivityMetadata metadata)
        {
            if (this.cacheId == owner.CacheId)
            {
                // We've already visited this node during this pass
                if (!object.ReferenceEquals(this.owner, owner))
                {
                    metadata.AddValidationError(SR.FlowNodeCannotBeShared(this.owner.DisplayName, owner.DisplayName));
                }

                // Whether we found an issue or not we don't want to change
                // the metadata during this pass.
                return false;
            }

            // if owner.ValidateUnconnectedNodes - Flowchart will be responsible for calling OnOpen for all the Nodes (connected and unconnected)
            if (!owner.ValidateUnconnectedNodes)
            {
                OnOpen(owner, metadata);
            }
            this.owner = owner;
            this.cacheId = owner.CacheId;
            this.Index = -1;

            return true;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:27,代码来源:FlowNode.cs

示例6: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     if (this.branchBodies == null)
     {
         this.branchBodies = new Collection<Activity>();
     }
     else
     {
         this.branchBodies.Clear();
     }
     foreach (PickBranch branch in this.Branches)
     {
         if (branch.Trigger == null)
         {
             metadata.AddValidationError(System.Activities.SR.PickBranchRequiresTrigger(branch.DisplayName));
         }
         PickBranchBody item = new PickBranchBody {
             Action = branch.Action,
             DisplayName = branch.DisplayName,
             Trigger = branch.Trigger,
             Variables = branch.Variables
         };
         this.branchBodies.Add(item);
     }
     metadata.SetChildrenCollection(this.branchBodies);
     metadata.AddImplementationVariable(this.pickStateVariable);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:Pick.cs

示例7: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            if (GetNextVectors.IsNull()) metadata.AddValidationError("GetNextVectors function is expected.");

            base.CacheMetadata(metadata);

            metadata.AddDelegate(GetNextVectors);
            metadata.AddImplementationVariable(vectorList);
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:9,代码来源:StreamBatcher.cs

示例8: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            //call base.CacheMetadata to add the Activities and Variables to this activity's metadata
            base.CacheMetadata(metadata);

            string errorMessage = AutomationActivityValidation();
            if (!string.IsNullOrEmpty(errorMessage))
                metadata.AddValidationError(errorMessage);
        }
开发者ID:bperreault,项目名称:autox,代码行数:9,代码来源:TestScreenActivity.cs

示例9: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            //call base.CacheMetadata to add the Variables, Condition, and Body to the activity's metadata
            base.CacheMetadata(metadata);

            if (this.Condition == null)
            {
                //MyWhile requires a Condition expression so - add a validation error if one isn't present
                metadata.AddValidationError(string.Format("While {0} requires a Condition", this.DisplayName));
                return;
            }
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:12,代码来源:MyWhile.cs

示例10: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     if (this.Body == null)
     {
         metadata.AddValidationError("The Body property must contain an Activity.");
     }
     else if (impl == null)
     {
         CreateImplementation();
         metadata.AddChild(impl);
     }
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:12,代码来源:OperationScope.cs

示例11: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     metadata.SetVariablesCollection(this.Variables);
     metadata.AddChild(this.Body);
     if (this.Condition == null)
     {
         metadata.AddValidationError(System.Activities.SR.WhileRequiresCondition(base.DisplayName));
     }
     else
     {
         metadata.AddChild(this.Condition);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:While.cs

示例12: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
     RuntimeArgument argument = new RuntimeArgument("Reason", typeof(string), ArgumentDirection.In, false);
     metadata.Bind(this.Reason, argument);
     RuntimeArgument argument2 = new RuntimeArgument("Exception", typeof(System.Exception), ArgumentDirection.In, false);
     metadata.Bind(this.Exception, argument2);
     arguments.Add(argument);
     arguments.Add(argument2);
     metadata.SetArgumentsCollection(arguments);
     if (((this.Reason == null) || this.Reason.IsEmpty) && ((this.Exception == null) || this.Exception.IsEmpty))
     {
         metadata.AddValidationError(System.Activities.SR.OneOfTwoPropertiesMustBeSet("Reason", "Exception", "TerminateWorkflow", base.DisplayName));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:TerminateWorkflow.cs

示例13: Open

 internal bool Open(Flowchart owner, NativeActivityMetadata metadata)
 {
     if (this.cacheId == owner.CacheId)
     {
         if (!object.ReferenceEquals(this.owner, owner))
         {
             metadata.AddValidationError(System.Activities.SR.FlowNodeCannotBeShared(this.owner.DisplayName, owner.DisplayName));
         }
         return false;
     }
     this.OnOpen(owner, metadata);
     this.owner = owner;
     this.cacheId = owner.CacheId;
     this.Index = -1;
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:FlowNode.cs

示例14: MarkStatesViaChildren

 private void MarkStatesViaChildren(NativeActivityMetadata metadata, Collection<System.Activities.Statements.State> states)
 {
     if (states.Count > 0)
     {
         for (int i = 0; i < states.Count; i++)
         {
             System.Activities.Statements.State state = states[i];
             if (string.IsNullOrEmpty(state.StateId))
             {
                 state.StateId = StateMachineIdHelper.GenerateStateId("0", i);
                 state.StateMachineName = base.DisplayName;
             }
             else
             {
                 bool isWarning = false;
                 metadata.AddValidationError(new ValidationError(System.Activities.SR.StateCannotBeAddedTwice(state.DisplayName), isWarning));
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:StateMachine.cs

示例15: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     if (this.TaskBody != null)
     {
         metadata.AddChild(this.TaskBody);
         if (ContainsTaskActivity(this.TaskBody))
         {
             metadata.AddValidationError(typeof(TaskActivityAssignException).Name);
         }
     }
 }
开发者ID:barbarossia,项目名称:CWF,代码行数:11,代码来源:TaskActivity.cs


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