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


C# IPolicyList.GetNoDefault方法代码示例

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


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

示例1: GetBehaviorsPolicy

 /// <summary>
 /// Get the list of behaviors for the current type so that it can be added to.
 /// </summary>
 /// <param name="policies">Policy list.</param>
 /// <param name="implementationType">Implementation type to set behaviors for.</param>
 /// <param name="name">Name type is registered under.</param>
 /// <returns>An instance of <see cref="InterceptionBehaviorsPolicy"/>.</returns>
 protected override InterceptionBehaviorsPolicy GetBehaviorsPolicy(IPolicyList policies, Type implementationType,
     string name)
 {
     var policy = policies.GetNoDefault<IInterceptionBehaviorsPolicy>(implementationType, false);
     if ((policy == null) || !(policy is InterceptionBehaviorsPolicy))
     {
         policy = new InterceptionBehaviorsPolicy();
         policies.Set(policy, implementationType);
     }
     return (InterceptionBehaviorsPolicy) policy;
 }
开发者ID:jorgeds001,项目名称:CodeSamples,代码行数:18,代码来源:DefaultInterceptionBehavior.cs

示例2: GetOrCreate

 internal static InterceptionBehaviorsPolicy GetOrCreate(
     IPolicyList policies,
     Type typeToCreate,
     string name)
 {
     NamedTypeBuildKey key = new NamedTypeBuildKey(typeToCreate, name);
     IInterceptionBehaviorsPolicy policy =
         policies.GetNoDefault<IInterceptionBehaviorsPolicy>(key, false);
     if ((policy == null) || !(policy is InterceptionBehaviorsPolicy))
     {
         policy = new InterceptionBehaviorsPolicy();
         policies.Set<IInterceptionBehaviorsPolicy>(policy, key);
     }
     return (InterceptionBehaviorsPolicy)policy;
 }
开发者ID:kangkot,项目名称:unity,代码行数:15,代码来源:InterceptionBehaviorsPolicy.cs

示例3: GetOrCreate

 internal static AdditionalInterfacesPolicy GetOrCreate(
     IPolicyList policies,
     Type typeToCreate,
     string name)
 {
     NamedTypeBuildKey key = new NamedTypeBuildKey(typeToCreate, name);
     IAdditionalInterfacesPolicy policy =
         policies.GetNoDefault<IAdditionalInterfacesPolicy>(key, false);
     if ((policy == null) || !(policy is AdditionalInterfacesPolicy))
     {
         policy = new AdditionalInterfacesPolicy();
         policies.Set<IAdditionalInterfacesPolicy>(policy, key);
     }
     return (AdditionalInterfacesPolicy)policy;
 }
开发者ID:shhyder,项目名称:MapApplication,代码行数:15,代码来源:AdditionalInterfacesPolicy.cs

示例4: GetSelectorPolicy

        private static SpecifiedPropertiesSelectorPolicy GetSelectorPolicy(IPolicyList policies, Type typeToInject, string name)
        {
            var key = new NamedTypeBuildKey(typeToInject, name);
             var selector =
             policies.GetNoDefault<IPropertySelectorPolicy>(key, false);

             if (selector == null)
             {
            var defaultSelector =
               policies.Get<IPropertySelectorPolicy>(key, false) as FullAutowirePropertySelectorPolicy;
            if (defaultSelector != null)
            {
               selector = defaultSelector.Clone();
               policies.Set(selector, key);
            }
            else
            {
               throw new InvalidOperationException("Cannot use AutiviewEnabledInjectionProperty without FullAutowireContainerExtension. Please register FullAutowireContainerExtension extension in the container.");
            }
             }
             return ((FullAutowirePropertySelectorPolicy)selector).SpecifiedPropertiesPolicy;
        }
开发者ID:rsummer,项目名称:NServiceBus,代码行数:22,代码来源:AutowireEnabledInjectionProperty.cs

示例5: GetSelectorPolicy

 private static SpecifiedPropertiesSelectorPolicy GetSelectorPolicy(IPolicyList policies, Type typeToInject, string name)
 {
     NamedTypeBuildKey key = new NamedTypeBuildKey(typeToInject, name);
     IPropertySelectorPolicy selector =
         policies.GetNoDefault<IPropertySelectorPolicy>(key, false);
     if (selector == null || !(selector is SpecifiedPropertiesSelectorPolicy))
     {
         selector = new SpecifiedPropertiesSelectorPolicy();
         policies.Set<IPropertySelectorPolicy>(selector, key);
     }
     return (SpecifiedPropertiesSelectorPolicy)selector;
 }
开发者ID:theoju,项目名称:CleanCode,代码行数:12,代码来源:InjectionProperty.cs

示例6: GetSelectorPolicy

 private static SpecifiedMethodsSelectorPolicy GetSelectorPolicy(IPolicyList policies, Type typeToCreate, string name)
 {
     var key = new NamedTypeBuildKey(typeToCreate, name);
     var selector = policies.GetNoDefault<IMethodSelectorPolicy>(key, false);
     if (selector == null || !(selector is SpecifiedMethodsSelectorPolicy))
     {
         selector = new SpecifiedMethodsSelectorPolicy();
         policies.Set<IMethodSelectorPolicy>(selector, key);
     }
     return (SpecifiedMethodsSelectorPolicy)selector;
 }
开发者ID:CFMITL,项目名称:unity,代码行数:11,代码来源:InjectionMethod.cs


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