• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SecurityAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CreateControl

		// LinkDemand

		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			// no public ctor is available but we know that it's properties don't have any restrictions
			MethodInfo mi = this.Type.GetProperty ("AcceptTypes").GetGetMethod ();
			Assert.IsNotNull (mi, "get_AcceptTypes");
			return mi.Invoke (response.Cache.VaryByHeaders, null);
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:HttpCacheVaryByHeadersCas.cs


示例2: CreateControl

		// LinkDemand

		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			// static class 2.0 / no public ctor before (1.x)
			MethodInfo mi = this.Type.GetMethod ("EnumToString");
			Assert.IsNotNull (mi, "EnumToString");
			return mi.Invoke (null, new object[2] { typeof(SecurityAction), SecurityAction.Demand });
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:PropertyConverterCas.cs


示例3: CreateControl

		// LinkDemand

		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			// no public ctor but we know the properties aren't protected
			MethodInfo mi = this.Type.GetProperty ("Visible").GetGetMethod ();
			Assert.IsNotNull (mi, "Visible");
			return mi.Invoke (pager_style, null);
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:DataGridPagerStyleCas.cs


示例4: ServiceControllerPermissionAttribute

		public ServiceControllerPermissionAttribute (SecurityAction action)
			: base (action)
		{
			machine_name = ResourcePermissionBase.Local;
			service_name = ResourcePermissionBase.Any;
			permission_access = ServiceControllerPermissionAccess.Browse;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:ServiceControllerPermissionAttribute.cs


示例5: CreateControl

		// LinkDemand

		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			ConstructorInfo ci = this.Type.GetConstructor (new Type[7] { typeof (string), typeof (string),
				typeof (int), typeof (string), typeof (string), typeof (string), typeof (BuildMethod) });
			Assert.IsNotNull (ci, ".ctor(2xstring,int,3xstring,BuildMethod)");
			return ci.Invoke (new object[7] { null, null, null, null, null, null, null });
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:StaticPartialCachingControlCas.cs


示例6: PerformanceCounterPermissionAttribute

	// Constructors.
	public PerformanceCounterPermissionAttribute(SecurityAction action)
			: base(action)
			{
				machineName = ".";
				categoryName = "*";
				permissionAccess = PerformanceCounterPermissionAccess.Browse;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:PerformanceCounterPermissionAttribute.cs


示例7: CreateControlStringCtor

		private object CreateControlStringCtor (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			// not public empty (default) ctor - at least not before 2.0
			ConstructorInfo ci = this.Type.GetConstructor (new Type[1] { typeof (string) });
			Assert.IsNotNull (ci, ".ctor(string)");
			return ci.Invoke (new object[1] { tempFile });
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:CacheDependencyCas.cs


示例8: HostProtectionAttribute

 public HostProtectionAttribute( SecurityAction action )
     : base( action ) 
 { 
     if (action != SecurityAction.LinkDemand)
         throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag")); 
     Contract.EndContractBlock();
 }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:7,代码来源:HostProtectionPermission.cs


示例9: CreateControl

		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			if ((level != AspNetHostingPermissionLevel.None) && (action == SecurityAction.PermitOnly))
				return UnmanagedCreateControl (action, level);
			else
				return base.CreateControl (action, level);
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:CacheCas.cs


示例10: AddDeclarativeSecurity

 public void AddDeclarativeSecurity(SecurityAction action, PermissionSet pset)
 {
     lock (this.SyncRoot)
     {
         this.AddDeclarativeSecurityNoLock(action, pset);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:TypeBuilder.cs


示例11: CreateControl

		// LinkDemand

		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			// no public ctor is available but we know the Count property isn't protected
			MethodInfo mi = this.Type.GetProperty ("Count").GetGetMethod ();
			Assert.IsNotNull (mi, "Count");
			return mi.Invoke (css, null);
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:CssStyleCollectionCas.cs


示例12: PerformanceCounterPermissionAttribute

		public PerformanceCounterPermissionAttribute (SecurityAction action) 
			: base (action)
		{
			categoryName = ResourcePermissionBase.Any;
			machineName = ResourcePermissionBase.Local;
			permissionAccess = PerformanceCounterPermissionAccess.Write;
		}
开发者ID:Xipas,项目名称:Symplified.Auth,代码行数:7,代码来源:PerformanceCounterPermissionAttribute.cs


示例13: CreateControl

		// LinkDemand

		public override object CreateControl (SecurityAction action, AspNetHostingPermissionLevel level)
		{
			// there are no public ctor so we're taking a method that we know isn't protected
			// (by a Demand) and call it thru reflection so any linkdemand (on the class) will
			// be promoted to a Demand
			MethodInfo mi = this.Type.GetProperty ("AllKeys").GetGetMethod ();
			return mi.Invoke (appstate, null);
		}
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:HttpApplicationStateCas.cs


示例14: Action

		public Action (SecurityAction action)
		{
			this.action = action;
			this.TextView = new TextView ();
			this.TextView.Editable = false;
			this.Expander = new Expander (action.ToString ());
			this.Expander.Add (this.TextView);
		}
开发者ID:transformersprimeabcxyz,项目名称:cecil-old,代码行数:8,代码来源:DeclarativeSecurityVisualizer.cs


示例15: HostProtectionAttribute

		public HostProtectionAttribute (SecurityAction action)
			: base (action) 
		{
			if (action != SecurityAction.LinkDemand) {
				string msg = String.Format (Locale.GetText ("Only {0} is accepted."), SecurityAction.LinkDemand);
				throw new ArgumentException (msg, "action");
			}
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:8,代码来源:HostProtectionAttribute.cs


示例16: DeclSecurity

 internal DeclSecurity(PEReader buff)
 {
     Contract.Requires(buff != null);
     action = (SecurityAction)buff.ReadUInt16();
     parentIx = buff.GetCodedIndex(CIx.HasDeclSecurity);
     permissionSet = buff.GetBlob();
     tabIx = MDTable.DeclSecurity;
 }
开发者ID:dbremner,项目名称:perwapi,代码行数:8,代码来源:MDElements.cs


示例17: EventLogPermissionAttribute

		public EventLogPermissionAttribute (SecurityAction action)
			: base (action)
		{
			machineName = ResourcePermissionBase.Local;
#if NET_2_0
			permissionAccess = EventLogPermissionAccess.Write;
#else
			permissionAccess = EventLogPermissionAccess.Browse;
#endif
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:10,代码来源:EventLogPermissionAttribute.cs


示例18: HostProtectionAttribute

#pragma warning disable 618
        public HostProtectionAttribute( SecurityAction action )
#pragma warning restore 618
            : base( action )
        {
#pragma warning disable 618
            if (action != SecurityAction.LinkDemand)
#pragma warning restore 618
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"));
            Contract.EndContractBlock();
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:11,代码来源:hostprotectionpermission.cs


示例19: PerformanceCounterPermissionAttribute

		public PerformanceCounterPermissionAttribute (SecurityAction action) 
			: base (action)
		{
			categoryName = ResourcePermissionBase.Any;
			machineName = ResourcePermissionBase.Local;
#if NET_2_0
			permissionAccess = PerformanceCounterPermissionAccess.Write;
#else
			permissionAccess = PerformanceCounterPermissionAccess.Browse;
#endif
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:11,代码来源:PerformanceCounterPermissionAttribute.cs


示例20: MakeSecurityException

        [System.Security.SecurityCritical]  // auto-generated
#pragma warning disable 618
        internal static Exception MakeSecurityException(AssemblyName asmName, Evidence asmEvidence, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
#pragma warning restore 618
        {
#if FEATURE_CAS_POLICY            
            // See if we need to throw a HostProtectionException instead
            HostProtectionPermission hostProtectionPerm = permThatFailed as HostProtectionPermission;
            if(hostProtectionPerm != null)
                return new HostProtectionException(GetResString("HostProtection_HostProtection"), HostProtectionPermission.protectedResources, hostProtectionPerm.Resources);

            // Produce relevant strings
            String message = "";
            MethodInfo method = null;
            try
            {
                if(granted == null && refused == null && demand == null)
                {
                    message = GetResString("Security_NoAPTCA");
                }
                else
                {
                    if(demand != null && demand is IPermission)
                        message = String.Format(CultureInfo.InvariantCulture,  GetResString("Security_Generic"), demand.GetType().AssemblyQualifiedName );
                    else if (permThatFailed != null)
                        message = String.Format(CultureInfo.InvariantCulture, GetResString("Security_Generic"), permThatFailed.GetType().AssemblyQualifiedName);
                    else
                        message = GetResString("Security_GenericNoType");
                }

                method = SecurityRuntime.GetMethodInfo(rmh);
            }
            catch(Exception e)
            {
                // Environment.GetResourceString will throw if we are ReadyForAbort (thread abort).  (We shouldn't do a Contract.Assert in this case or it will lock up the thread.)
                if(e is System.Threading.ThreadAbortException)
                throw;
            }

/*            catch(System.Threading.ThreadAbortException)
            {
                // Environment.GetResourceString will throw if we are ReadyForAbort (thread abort).  (We shouldn't do a BCLDebug.Assert in this case or it will lock up the thread.)
                throw;
            }
            catch
            {
            }
*/
            // make the exception object
            return new SecurityException(message, asmName, granted, refused, method, action, demand, permThatFailed, asmEvidence);
#else
            return new SecurityException(GetResString("Arg_SecurityException"));
#endif

        }
开发者ID:REALTOBIZ,项目名称:mono,代码行数:55,代码来源:securityexception.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SecurityBindingElement类代码示例发布时间:2022-05-24
下一篇:
C# Security类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap