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


C# NativeActivityMetadata.Bind方法代码示例

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


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

示例1: CacheMetadata

        /// <summary>
        /// The cache metadata.
        /// </summary>
        /// <param name="metadata">
        /// The metadata.
        /// </param>
        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            metadata.RequireExtension<IMessagingStub>();

            var parametersContent = this.Content as ReceiveParametersContent;

            if (parametersContent != null)
            {
                foreach (var pair in parametersContent.Parameters)
                {
                    var argument = new RuntimeArgument(pair.Key, pair.Value.ArgumentType, ArgumentDirection.Out);
                    metadata.Bind(pair.Value, argument);
                    metadata.AddArgument(argument);
                }
            }

            var messageContent = this.Content as ReceiveMessageContent;
            if (messageContent != null)
            {
                var runtimeArgumentType = (messageContent.Message == null) ? typeof(object) : messageContent.Message.ArgumentType;
                var argument = new RuntimeArgument("Message", runtimeArgumentType, ArgumentDirection.Out);
                metadata.Bind(messageContent.Message, argument);
                metadata.AddArgument(argument);
            }

            // Note: Not adding other properties here as arguments
        }
开发者ID:IcodeNet,项目名称:cleansolution,代码行数:33,代码来源:ReceiveStubBase.cs

示例2: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     if (this.Result != null)
     {
         RuntimeArgument argument = new RuntimeArgument("Result", this.Result.ArgumentType, ArgumentDirection.In);
         metadata.Bind(this.Result, argument);
         metadata.AddArgument(argument);
     }
     if (this.parameters != null)
     {
         int num = 0;
         foreach (InArgument argument2 in this.parameters)
         {
             RuntimeArgument argument3 = new RuntimeArgument("Parameter" + num++, argument2.ArgumentType, ArgumentDirection.In);
             metadata.Bind(argument2, argument3);
             metadata.AddArgument(argument3);
         }
     }
     RuntimeArgument argument4 = new RuntimeArgument("Message", System.ServiceModel.Activities.Constants.MessageType, ArgumentDirection.Out, true);
     metadata.Bind(this.Message, argument4);
     metadata.AddArgument(argument4);
     RuntimeArgument argument5 = new RuntimeArgument("CorrelatesWith", System.ServiceModel.Activities.Constants.CorrelationHandleType, ArgumentDirection.In);
     metadata.Bind(this.CorrelatesWith, argument5);
     metadata.AddArgument(argument5);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:ToReply.cs

示例3: 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

示例4: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            RuntimeArgument argument;

            argument = new RuntimeArgument("JobGuid", typeof(Guid), ArgumentDirection.In);
            metadata.Bind(this.JobGuid, argument);
            metadata.AddArgument(argument);

            argument = new RuntimeArgument("UserGuid", typeof(Guid), ArgumentDirection.In);
            metadata.Bind(this.UserGuid, argument);
            metadata.AddArgument(argument);

            if (this.Try != null)
            {
                metadata.AddChild(this.Try);
            }
            if (this.Finally != null)
            {
                metadata.AddChild(this.Finally);
            }

            argument = new RuntimeArgument("MaxRetries", typeof(int), ArgumentDirection.In);
            metadata.Bind(this.MaxRetries, argument);
            metadata.AddArgument(argument);

            metadata.AddImplementationVariable(this.retries);
        }
开发者ID:skyquery,项目名称:graywulf,代码行数:27,代码来源:Retry.cs

示例5: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
     RuntimeArgument argument = new RuntimeArgument("Message", typeof(string), ArgumentDirection.In);
     metadata.Bind(this.Message, argument);
     arguments.Add(argument);
     RuntimeArgument argument2 = new RuntimeArgument("IsWarning", typeof(bool), ArgumentDirection.In, false);
     metadata.Bind(this.IsWarning, argument2);
     arguments.Add(argument2);
     RuntimeArgument argument3 = new RuntimeArgument("PropertyName", typeof(string), ArgumentDirection.In, false);
     metadata.Bind(this.PropertyName, argument3);
     arguments.Add(argument3);
     metadata.SetArgumentsCollection(arguments);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:AddValidationError.cs

示例6: 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

示例7: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            RuntimeArgument valuesArgument = new RuntimeArgument("Values", typeof(IEnumerable), ArgumentDirection.In, true);
            metadata.Bind(this.Values, valuesArgument);
            metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { valuesArgument });

            // declare the CompletionCondition as a child
            if (this.CompletionCondition != null)
            {
                metadata.SetChildrenCollection(new Collection<Activity> { this.CompletionCondition });
            }

            // declare the hasCompleted variable
            if (this.CompletionCondition != null)
            {
                if (this.hasCompleted == null)
                {
                    this.hasCompleted = new Variable<bool>();
                }

                metadata.AddImplementationVariable(this.hasCompleted);
            }

            metadata.AddDelegate(this.Body);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:25,代码来源:ParallelForEach.cs

示例8: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            RuntimeArgument subInstanceArgument = new RuntimeArgument("Scope", typeof(BookmarkScope), ArgumentDirection.In);
            metadata.Bind(this.Scope, subInstanceArgument);

            metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { subInstanceArgument });
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:DeleteBookmarkScope.cs

示例9: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            RuntimeArgument targetArgument = new RuntimeArgument("Target", typeof(CompensationToken), ArgumentDirection.In);
            metadata.Bind(this.Target, targetArgument);

            metadata.SetArgumentsCollection(
                new Collection<RuntimeArgument>
                {
                    targetArgument
                });

            metadata.SetImplementationVariablesCollection(
                new Collection<Variable>
                {
                    this.currentCompensationToken
                });

            Fx.Assert(DefaultConfirmation != null, "DefaultConfirmation must be valid");
            Fx.Assert(InternalConfirm != null, "InternalConfirm must be valid");
            metadata.SetImplementationChildrenCollection(
                new Collection<Activity>
                {
                    DefaultConfirmation, 
                    InternalConfirm
                });
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:Confirm.cs

示例10: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     RuntimeArgument argument = new RuntimeArgument("Duration", typeof(TimeSpan), ArgumentDirection.In, true);
     metadata.Bind(this.Duration, argument);
     metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { argument });
     metadata.AddImplementationVariable(this.timerBookmark);
     metadata.AddDefaultExtensionProvider<TimerExtension>(getDefaultTimerExtension);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:Delay.cs

示例11: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     metadata.RequireExtension<ICountModel>();
     var currentCountArg = new RuntimeArgument(
         "CurrentCount", typeof(Int32), ArgumentDirection.In);
     metadata.AddArgument(currentCountArg);
     metadata.Bind(this.CurrentCount, currentCountArg);
 }
开发者ID:mac10688,项目名称:PublicWorkspace,代码行数:8,代码来源:NotifyCountUpdated.cs

示例12: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     RuntimeArgument argument = new RuntimeArgument("Target", typeof(CompensationToken), ArgumentDirection.In);
     metadata.Bind(this.Target, argument);
     metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { argument });
     metadata.SetImplementationVariablesCollection(new Collection<Variable> { this.toConfirmToken });
     metadata.SetImplementationChildrenCollection(new Collection<Activity> { this.Body });
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:DefaultConfirmation.cs

示例13: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            RuntimeArgument valuesArgument = new RuntimeArgument("Values", typeof(IEnumerable), ArgumentDirection.In, true);
            metadata.Bind(this.Values, valuesArgument);

            metadata.AddArgument(valuesArgument);
            metadata.AddDelegate(this.Body);
            metadata.AddImplementationVariable(this.valueEnumerator);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:9,代码来源:ForEach.cs

示例14: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            RuntimeArgument messageArgument = new RuntimeArgument(Constants.Message, Constants.MessageType, ArgumentDirection.InOut, true);
            metadata.Bind(this.Message, messageArgument);
            metadata.AddArgument(messageArgument);

            if (this.parameters != null)
            {
                int count = 0;
                foreach (OutArgument parameter in this.parameters)
                {
                    RuntimeArgument parameterArgument = new RuntimeArgument(Constants.Parameter + count++, parameter.ArgumentType, ArgumentDirection.Out);
                    metadata.Bind(parameter, parameterArgument);
                    metadata.AddArgument(parameterArgument);
                }
            }

            RuntimeArgument noPersistHandleArgument = new RuntimeArgument(Constants.NoPersistHandle, Constants.NoPersistHandleType, ArgumentDirection.In);
            metadata.Bind(this.NoPersistHandle, noPersistHandleArgument);
            metadata.AddArgument(noPersistHandleArgument);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:21,代码来源:FromRequest.cs

示例15: 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


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