C# Type IsSecuritySafeCritical
Description
Type IsSecuritySafeCritical
gets a value that indicates
whether the current type is security-safe-critical at the current trust
level; that is, whether it can perform critical operations and can be accessed
by transparent code.
Syntax
Type.IsSecuritySafeCritical
has the following syntax.
public virtual bool IsSecuritySafeCritical { get; }
Example
//from ww w . java 2 s . c om
using System;
namespace SystemType
{
public class MyClass
{
sealed public class MyTestClass
{
}
public static void Main(string []args)
{
try
{
bool myBool = false;
MyTestClass myTestClassInstance = new MyTestClass();
Type myType = myTestClassInstance.GetType();
Console.WriteLine(myType.IsSecuritySafeCritical);
}
catch (Exception e)
{
Console.WriteLine("\nAn exception occurred: {0}",e.Message);
}
}
}
}
The code above generates the following result.