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


C# Permission.newPermissionCollection方法代码示例

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


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

示例1: resolveCollection

 /**
  * Resolves all permissions of the same class as the specified target
  * permission and adds them to the specified collection. If passed
  * collection is {@code null} and some unresolved permissions were resolved,
  * an appropriate new collection is instantiated and used. All resolved
  * permissions are removed from this unresolved collection, and collection
  * with resolved ones is returned.
  *
  * @param target
  *            a kind of permissions to be resolved.
  * @param holder
  *            an existing collection for storing resolved permissions.
  * @return a collection containing resolved permissions (if any found)
  */
 internal PermissionCollection resolveCollection(Permission target,
                                        PermissionCollection holder)
 {
     String klass = target.getClass().getName();
     if (klasses.containsKey(klass))
     {
         lock (klasses)
         {
             java.util.Collection<Object> klassMates = (java.util.Collection<Object>)klasses.get(klass);
             for (java.util.Iterator<Object> iter = klassMates.iterator(); iter.hasNext(); )
             {
                 UnresolvedPermission element = (UnresolvedPermission)iter
                     .next();
                 Permission resolved = element.resolve(target.getClass());
                 if (resolved != null)
                 {
                     if (holder == null)
                     {
                         holder = target.newPermissionCollection();
                         if (holder == null)
                         {
                             holder = new PermissionsHash();
                         }
                     }
                     holder.add(resolved);
                     iter.remove();
                 }
             }
             if (klassMates.size() == 0)
             {
                 klasses.remove(klass);
             }
         }
     }
     return holder;
 }
开发者ID:sailesh341,项目名称:JavApi,代码行数:50,代码来源:UnresolvedPermissionCollection.cs


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