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


C# IPolicyList.Clear方法代码示例

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


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

示例1: RemoveResolvers

 /// <summary>
 /// Remove the currently tracked resolvers from the given policy list.
 /// </summary>
 /// <param name="policies">Policy list to remove the resolvers from.</param>
 public void RemoveResolvers(IPolicyList policies)
 {
     foreach(object key in keys)
     {
         policies.Clear<IDependencyResolverPolicy>(key);
     }
     keys.Clear();
 }
开发者ID:jorgeds001,项目名称:CodeSamples,代码行数:12,代码来源:DependencyResolverTrackerPolicy.cs

示例2: AddPolicies

 /// <summary>
 /// Add policies to the <paramref name="policies"/> to configure the container to use the represented 
 /// <see cref="IInterceptor"/> for the supplied parameters.
 /// </summary>
 /// <param name="serviceType">Interface being registered.</param>
 /// <param name="implementationType">Type to register.</param>
 /// <param name="name">Name used to resolve the type object.</param>
 /// <param name="policies">Policy list to add policies to.</param>
 public override void AddPolicies(Type serviceType, Type implementationType, string name, IPolicyList policies)
 {
     var key = new NamedTypeBuildKey(implementationType, name);
     if(IsInstanceInterceptor)
     {
         var policy = CreateInstanceInterceptionPolicy();
         policies.Set<IInstanceInterceptionPolicy>(policy, key);
         policies.Clear<ITypeInterceptionPolicy>(key);
     }
     else
     {
         var policy = CreateTypeInterceptionPolicy();
         policies.Set<ITypeInterceptionPolicy>(policy, key);
         policies.Clear<IInstanceInterceptionPolicy>(key);
     }
 }
开发者ID:shhyder,项目名称:MapApplication,代码行数:24,代码来源:Interceptor.cs

示例3: RemoveResolvers

        /// <summary>
        /// Remove the currently tracked resolvers from the given policy list.
        /// </summary>
        /// <param name="policies">Policy list to remove the resolvers from.</param>
        public void RemoveResolvers(IPolicyList policies)
        {
            var allKeys = new List<object>();
            lock (this.keys)
            {
                allKeys.AddRange(this.keys);
                keys.Clear();
            }

            foreach (object key in allKeys)
            {
                policies.Clear<IDependencyResolverPolicy>(key);
            }
        }
开发者ID:kangkot,项目名称:unity,代码行数:18,代码来源:DependencyResolverTrackerPolicy.cs


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