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


C# Security.CodeAccessPermission类代码示例

本文整理汇总了C#中System.Security.CodeAccessPermission的典型用法代码示例。如果您正苦于以下问题:C# CodeAccessPermission类的具体用法?C# CodeAccessPermission怎么用?C# CodeAccessPermission使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CheckAssembly

 internal static void CheckAssembly(RuntimeAssembly asm, CodeAccessPermission demand)
 {
     PermissionSet set;
     PermissionSet set2;
     asm.GetGrantSet(out set, out set2);
     CheckHelper(set, set2, demand, PermissionToken.GetToken(demand), RuntimeMethodHandleInternal.EmptyHandle, asm, SecurityAction.Demand, true);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:CodeAccessSecurityEngine.cs

示例2: CheckDemand

		internal bool CheckDemand (CodeAccessPermission target)
		{
			if (target == null)
				return false;
			if (target.GetType () != this.GetType ())
				return false;
			return IsSubsetOf (target);
		}
开发者ID:runefs,项目名称:Marvin,代码行数:8,代码来源:CodeAccessPermission.cs

示例3: CheckAssert

		internal bool CheckAssert (CodeAccessPermission asserted)
		{
			if (asserted == null)
				return false;
			if (asserted.GetType () != this.GetType ())
				return false;
			return IsSubsetOf (asserted);
		}
开发者ID:runefs,项目名称:Marvin,代码行数:8,代码来源:CodeAccessPermission.cs

示例4: CheckDemand

 internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
 {
     if (!CheckAssert(this.AssertSet, demand, permToken))
     {
         return false;
     }
     CodeAccessSecurityEngine.CheckHelper(this.GrantSet, this.RefusedSet, demand, permToken, rmh, null, SecurityAction.Demand, true);
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:PermissionSetTriple.cs

示例5: CheckDemand

 internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandle rmh)
 {
     this.CompleteConstruction(null);
     if (this.PLS != null)
     {
         this.PLS.CheckDemand(demand, permToken, rmh);
     }
     return false;
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:9,代码来源:CompressedStack.cs

示例6: CheckDemandNoThrow

 internal bool CheckDemandNoThrow(CodeAccessPermission demand)
 {
     PermissionToken permToken = null;
     if (demand != null)
     {
         permToken = PermissionToken.GetToken(demand);
     }
     return this.m_firstPermSetTriple.CheckDemandNoThrow(demand, permToken);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:PermissionListSet.cs

示例7: CheckDemand

 internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
 {
     bool flag = this.CheckDemand2(demand, permToken, rmh, false);
     if (flag)
     {
         flag = this.CheckDemand2(demand, permToken, rmh, true);
     }
     return flag;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:FrameSecurityDescriptor.cs

示例8: CheckDeny

 internal bool CheckDeny(CodeAccessPermission denied)
 {
     IPermission permission = this.Intersect(denied);
     if (permission != null)
     {
         return permission.IsSubsetOf(null);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:CodeAccessPermission.cs

示例9: IsPermissionGranted

 internal static bool IsPermissionGranted(CodeAccessPermission requestedPermission)
 {
     try
     {
         // Try and get this permission
         requestedPermission.Demand();
         return true;
     }
     catch
     {
         return false;
     }
 }
开发者ID:mdjabirov,项目名称:C1Decompiled,代码行数:13,代码来源:MainWindow.xaml.cs

示例10: CheckUnrestricted

     // Returns true if OK to return from check, or false if
     // permission-specific information must be checked.
     internal static bool CheckUnrestricted(IUnrestrictedPermission grant, CodeAccessPermission demand)
     {
         // We return true here because we're defining a demand of null to
         // automatically pass.
         if (demand == null)
             return true;
 
         if (demand.GetType() != grant.GetType())
             return false;
         if (grant.IsUnrestricted())
             return true;
         if (((IUnrestrictedPermission)demand).IsUnrestricted())
             throw new SecurityException(String.Format(Environment.GetResourceString("Security_Generic"), demand.GetType().FullName), demand.GetType(), demand.ToXml().ToString());
         return false;
     } 
开发者ID:ArildF,项目名称:masters,代码行数:17,代码来源:unrestrictedpermission.cs

示例11: CheckDeny

		internal bool CheckDeny (CodeAccessPermission denied)
		{
			if (denied == null)
				return true;
			Type t = denied.GetType ();
			if (t != this.GetType ())
				return true;
			IPermission inter = Intersect (denied);
			if (inter == null)
				return true;
			// sadly that's not enough :( at this stage we must also check
			// if an empty (PermissionState.None) is a subset of the denied
			// (which is like a empty intersection looks like for flag based
			// permissions, e.g. AspNetHostingPermission).
			return denied.IsSubsetOf (PermissionBuilder.Create (t));
		}
开发者ID:runefs,项目名称:Marvin,代码行数:16,代码来源:CodeAccessPermission.cs

示例12: CheckDemand

 internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
 {
     bool flag = true;
     if (this.m_permSetTriples != null)
     {
         for (int i = 0; (i < this.m_permSetTriples.Count) && flag; i++)
         {
             flag = ((PermissionSetTriple) this.m_permSetTriples[i]).CheckDemand(demand, permToken, rmh);
         }
     }
     else if (this.m_firstPermSetTriple != null)
     {
         flag = this.m_firstPermSetTriple.CheckDemand(demand, permToken, rmh);
     }
     return false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:PermissionListSet.cs

示例13: Assert

 internal static void Assert(CodeAccessPermission cap, ref StackCrawlMark stackMark)
 {
     FrameSecurityDescriptor descriptor = CheckNReturnSO(AssertPermissionToken, AssertPermission, ref stackMark, 1);
     if (descriptor == null)
     {
         Environment.FailFast(Environment.GetResourceString("ExecutionEngine_MissingSecurityDescriptor"));
     }
     else
     {
         if (descriptor.HasImperativeAsserts())
         {
             throw new SecurityException(Environment.GetResourceString("Security_MustRevertOverride"));
         }
         descriptor.SetAssert(cap);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:CodeAccessSecurityEngine.cs

示例14: CheckAssert

 private static bool CheckAssert(PermissionSet pSet, CodeAccessPermission demand, PermissionToken permToken)
 {
     if (pSet != null)
     {
         pSet.CheckDecoded(demand, permToken);
         CodeAccessPermission asserted = (CodeAccessPermission) pSet.GetPermission(demand);
         try
         {
             if (pSet.IsUnrestricted() || demand.CheckAssert(asserted))
             {
                 return false;
             }
         }
         catch (ArgumentException)
         {
         }
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:PermissionSetTriple.cs

示例15: CheckDemandNoThrow

        [System.Security.SecurityCritical]  // auto-generated
        internal bool CheckDemandNoThrow(CodeAccessPermission demand) 
        {
            // AppDomain permissions - no asserts. So there should only be one triple to work with 
            Contract.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); 

 

            PermissionToken permToken = null;
            if (demand != null)
                permToken = PermissionToken.GetToken(demand); 

            return m_firstPermSetTriple.CheckDemandNoThrow(demand, permToken); 
 

        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:16,代码来源:PermissionListSet.cs


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