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


C# NativeActivityMetadata.AddVariable方法代码示例

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


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

示例1: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     this.internalStateFuncs.Clear();
     this.internalStates.Clear();
     this.PassNumber++;
     this.TraverseViaTransitions(new Action<System.Activities.Statements.State>(StateMachine.ClearState), new Action<Transition>(StateMachine.ClearTransition));
     this.PassNumber++;
     bool checkReached = false;
     this.TraverseStates((m, states) => ClearStates(states), (m, state) => ClearTransitions(state), metadata, checkReached);
     this.PassNumber++;
     bool flag2 = false;
     this.TraverseStates(new Action<NativeActivityMetadata, Collection<System.Activities.Statements.State>>(this.MarkStatesViaChildren), (m, state) => MarkTransitionsInState(state), metadata, flag2);
     this.PassNumber++;
     this.TraverseViaTransitions(state => MarkStateViaTransition(state), null);
     this.PassNumber++;
     Action<Transition> actionForTransition = null;
     this.TraverseViaTransitions(state => ValidateTransitions(metadata, state), actionForTransition);
     this.PassNumber++;
     NativeActivityMetadata metadata2 = metadata;
     bool flag3 = true;
     this.TraverseStates(new Action<NativeActivityMetadata, Collection<System.Activities.Statements.State>>(StateMachine.ValidateStates), delegate (NativeActivityMetadata m, System.Activities.Statements.State state) {
         if (!state.Reachable)
         {
             ValidateTransitions(m, state);
         }
     }, metadata2, flag3);
     this.ValidateStateMachine(metadata);
     this.ProcessStates(metadata);
     metadata.AddImplementationVariable(this.eventManager);
     foreach (Variable variable in this.Variables)
     {
         metadata.AddVariable(variable);
     }
     metadata.AddDefaultExtensionProvider<StateMachineExtension>(getDefaultExtension);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:35,代码来源:StateMachine.cs

示例2: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     if (variables != null)
     {
         foreach (var v in Variables)
         {
             metadata.AddVariable(v);
         }
     }
 }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:10,代码来源:NativeActivityWithVariables.cs

示例3: CacheMetadata

        /// <summary>
        /// Do validation and if validation is successful, create internal representations for states and transitions.
        /// </summary>
        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            //cleanup
            this.internalStateFuncs.Clear();
            this.internalStates.Clear();

            //clear Ids and Flags via transitions
            this.PassNumber++;
            TraverseViaTransitions(ClearState, ClearTransition);
            //clear Ids and Flags via children
            this.PassNumber++;
            TraverseViaChildren(ClearStates, null, ClearTransitions, false);

            //Mark via children and do some check
            this.PassNumber++;
            TraverseViaChildren(MarkStatesViaChildren,
                delegate(State state) { StateCannotHaveMultipleParents(metadata, state); }, null, false);

            this.PassNumber++;
            //Mark via transition
            TraverseViaTransitions(delegate(State state) { MarkStateViaTransition(metadata, state); }, null);

            //Do validation via children
            //need not check the violation of state which is not reached
            this.PassNumber++;
            TraverseViaChildren(delegate(Collection<State> states) { ValidateStates(metadata, states); }, null,
                delegate(State state) { ValidateTransitions(metadata, state); }, true);

            //Validate the root state machine itself
            ValidateStateMachine(metadata);

            if (!metadata.HasViolations)
            {
                StateMachineHelper.ProcessChildStates(metadata, this.States, this.internalStates, this.internalStateFuncs);
            }
            metadata.AddImplementationVariable(this.eventManager);
            foreach (Variable variable in this.Variables)
            {
                metadata.AddVariable(variable);
            }
        }
开发者ID:xiluo,项目名称:document-management,代码行数:44,代码来源:StateMachine.cs

示例4: CacheMetadata

        /// <summary>
        /// Validate the required number of activities of pipeline activity.
        /// Setup the cachemetadata with variables and activities.
        /// </summary>
        /// <param name="metadata"></param>
        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            int count = 0;

            if (this.Activities != null)
            {
                count = this.Activities.Count;
            }

            if (count == 0)
            {
                metadata.AddValidationError(new ValidationError(ActivityResources.NoChildPipeline, true));
                return;
            }

            //BUGBUG: As written, the following checks cause error in scenarios where they should not. 
            // They are left in for the time being but disabled until we verify that there are no
            // scenarios where we need to check for two variables being assigned.
#if false
            if (Input != null && Input.Expression != null && this.Activities[0].Input != null && this.Activities[0].Input.Expression != null)
            {
                metadata.AddValidationError(new ValidationError(ActivityResources.DuplicateInputDefinedInPipeline, true));
                this.inputValidationFailed = true;
                return;
            }

            if (Result != null && Result.Expression != null && this.Activities[count - 1].Result != null && this.Activities[count - 1].Result.Expression != null)
            {
                metadata.AddValidationError(new ValidationError(ActivityResources.DuplicateResultDefinedInPipeline, true));
                this.resultValidationFailed = true;
                return;
            }
#endif
            // Adding variables into the CacheMetadata of pipeline activity.
            metadata.AddImplementationVariable(this.lastIndexHint);

            // We use a GUID here to make this name hard to guess. It's not a security issue,
            // it just prevents code from accidentally taking a dependency on it.
            this.OutputStream = new Variable<PSDataCollection<PSObject>>(Guid.NewGuid().ToString().Replace("-","_"));
            this.InputStream = new Variable<PSDataCollection<PSObject>>(Guid.NewGuid().ToString().Replace("-","_"));

            metadata.AddVariable(this.OutputStream);
            metadata.AddVariable(this.InputStream);

            bool appendOutput = false;
            if ((this.AppendOutput != null) && (this.AppendOutput.Value))
            {
                appendOutput = true;
            }

            // Adding activities into the CacheMetadata of pipeline activity.
            if (count == 1)
            {

                if (Input != null && Input.Expression != null)
                {
                    this.Activities[0].Input = this.Input;
                }

                if (Result != null && Result.Expression != null)
                {
                    this.Activities[0].Result = this.Result;
                }

                if (appendOutput)
                {
                    this.Activities[0].AppendOutput = true;
                }

                metadata.AddChild(this.Activities[0]);
            }
            else
            {

                if (Input != null && Input.Expression != null)
                {
                    this.Activities[0].Input = this.Input;
                }

                // Connecting child activities with temporary input and out streams.
                this.Activities[0].Result = this.OutputStream;
                metadata.AddChild(this.Activities[0]);

                for (int i = 1; i < (count - 1); i++)
                {
                    this.Activities[i].Input = this.InputStream;
                    this.Activities[i].Result = this.OutputStream;

                    metadata.AddChild(this.Activities[i]);
                }

                if (Result != null && Result.Expression != null)
                {
                    this.Activities[count - 1].Result = this.Result;
                }
//.........这里部分代码省略.........
开发者ID:40a,项目名称:PowerShell,代码行数:101,代码来源:Pipeline.cs

示例5: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            // child activities
            metadata.AddChild(this.Body);

            // arguments
            metadata.AddArgument(new RuntimeArgument("ConnectionString", typeof(string), ArgumentDirection.In, true));

            // variables
            metadata.AddImplementationVariable(this.noPersistHandle);
            foreach (Variable variable in this.variables)
            {
                metadata.AddVariable(variable);
            }

            base.CacheMetadata(metadata);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:17,代码来源:ObjectContextScope.cs


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