本文整理汇总了C#中System.Security.Permissions.RegistryPermission.IsUnrestricted方法的典型用法代码示例。如果您正苦于以下问题:C# RegistryPermission.IsUnrestricted方法的具体用法?C# RegistryPermission.IsUnrestricted怎么用?C# RegistryPermission.IsUnrestricted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.Permissions.RegistryPermission
的用法示例。
在下文中一共展示了RegistryPermission.IsUnrestricted方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PermissionStateUnrestricted
public void PermissionStateUnrestricted ()
{
RegistryPermission ep = new RegistryPermission (PermissionState.Unrestricted);
Assert.IsNotNull (ep, "RegistryPermission(PermissionState.Unrestricted)");
Assert.IsTrue (ep.IsUnrestricted (), "IsUnrestricted");
RegistryPermission copy = (RegistryPermission)ep.Copy ();
Assert.AreEqual (ep.IsUnrestricted (), copy.IsUnrestricted (), "Copy.IsUnrestricted");
SecurityElement se = ep.ToXml ();
Assert.AreEqual ("true", se.Attribute ("Unrestricted"), "ToXml-Unrestricted");
}
示例2: PermissionStateUnrestricted
public void PermissionStateUnrestricted ()
{
RegistryPermission ep = new RegistryPermission (PermissionState.Unrestricted);
AssertNotNull ("RegistryPermission(PermissionState.Unrestricted)", ep);
Assert ("IsUnrestricted", ep.IsUnrestricted ());
RegistryPermission copy = (RegistryPermission)ep.Copy ();
AssertEquals ("Copy.IsUnrestricted", ep.IsUnrestricted (), copy.IsUnrestricted ());
SecurityElement se = ep.ToXml ();
AssertEquals ("ToXml-Unrestricted", "true", se.Attribute ("Unrestricted"));
}
示例3: PermissionStateNone
public void PermissionStateNone ()
{
RegistryPermission ep = new RegistryPermission (PermissionState.None);
Assert.IsNotNull (ep, "RegistryPermission(PermissionState.None)");
Assert.IsTrue (!ep.IsUnrestricted (), "IsUnrestricted");
RegistryPermission copy = (RegistryPermission)ep.Copy ();
Assert.AreEqual (ep.IsUnrestricted (), copy.IsUnrestricted (), "Copy.IsUnrestricted");
SecurityElement se = ep.ToXml ();
Assert.IsTrue (se.Attribute ("class").StartsWith (className), "ToXml-class");
Assert.AreEqual ("1", se.Attribute ("version"), "ToXml-version");
}
示例4: PermissionStateNone
public void PermissionStateNone ()
{
RegistryPermission ep = new RegistryPermission (PermissionState.None);
AssertNotNull ("RegistryPermission(PermissionState.None)", ep);
Assert ("IsUnrestricted", !ep.IsUnrestricted ());
RegistryPermission copy = (RegistryPermission)ep.Copy ();
AssertEquals ("Copy.IsUnrestricted", ep.IsUnrestricted (), copy.IsUnrestricted ());
SecurityElement se = ep.ToXml ();
Assert ("ToXml-class", se.Attribute ("class").StartsWith (className));
AssertEquals ("ToXml-version", "1", se.Attribute ("version"));
}
示例5: ReadAccess
public void ReadAccess ()
{
RegistryPermission ep = new RegistryPermission (RegistryPermissionAccess.Read, keyLocalMachine);
Assert.IsTrue (!ep.IsUnrestricted (), "IsUnrestricted");
}
示例6: CreateAccess
public void CreateAccess ()
{
RegistryPermission ep = new RegistryPermission (RegistryPermissionAccess.Create, keyLocalMachine);
Assert ("IsUnrestricted", !ep.IsUnrestricted ());
}