CreatePermission() public méthode

public CreatePermission ( ) : IPermission
Résultat IPermission
		public void Default ()
		{
			KeyContainerPermissionAttribute a = new KeyContainerPermissionAttribute (SecurityAction.Assert);
			Assert.AreEqual (KeyContainerPermissionFlags.NoFlags, a.Flags, "Flags");
			Assert.IsNull (a.KeyContainerName, "KeyContainerName");
			Assert.AreEqual (-1, a.KeySpec, "KeySpec");
			Assert.IsNull (a.KeyStore, "KeyStore");
			Assert.IsNull (a.ProviderName, "ProviderName");
			Assert.AreEqual (-1, a.ProviderType, "ProviderType");

			Assert.IsFalse (a.Unrestricted, "Unrestricted");
			Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId");

			KeyContainerPermission perm = (KeyContainerPermission)a.CreatePermission ();
			Assert.AreEqual (KeyContainerPermissionFlags.NoFlags, perm.Flags, "perm.Flags");
			Assert.IsFalse (perm.IsUnrestricted (), "perm.Unrestricted");
		}