本文整理汇总了C#中SecurityAction类的典型用法代码示例。如果您正苦于以下问题:C# SecurityAction类的具体用法?C# SecurityAction怎么用?C# SecurityAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityAction类属于命名空间,在下文中一共展示了SecurityAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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 });
}
示例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);
}
示例4: ServiceControllerPermissionAttribute
public ServiceControllerPermissionAttribute (SecurityAction action)
: base (action)
{
machine_name = ResourcePermissionBase.Local;
service_name = ResourcePermissionBase.Any;
permission_access = ServiceControllerPermissionAccess.Browse;
}
示例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 });
}
示例6: PerformanceCounterPermissionAttribute
// Constructors.
public PerformanceCounterPermissionAttribute(SecurityAction action)
: base(action)
{
machineName = ".";
categoryName = "*";
permissionAccess = PerformanceCounterPermissionAccess.Browse;
}
示例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 });
}
示例8: HostProtectionAttribute
public HostProtectionAttribute( SecurityAction action )
: base( action )
{
if (action != SecurityAction.LinkDemand)
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"));
Contract.EndContractBlock();
}
示例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);
}
示例10: AddDeclarativeSecurity
public void AddDeclarativeSecurity(SecurityAction action, PermissionSet pset)
{
lock (this.SyncRoot)
{
this.AddDeclarativeSecurityNoLock(action, pset);
}
}
示例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);
}
示例12: PerformanceCounterPermissionAttribute
public PerformanceCounterPermissionAttribute (SecurityAction action)
: base (action)
{
categoryName = ResourcePermissionBase.Any;
machineName = ResourcePermissionBase.Local;
permissionAccess = PerformanceCounterPermissionAccess.Write;
}
示例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);
}
示例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);
}
示例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");
}
}