public void Unrestricted()
        {
            FileDialogPermissionAttribute a = new FileDialogPermissionAttribute(SecurityAction.Assert);

            a.Unrestricted = true;

            FileDialogPermission perm = (FileDialogPermission)a.CreatePermission();

            Assert.IsTrue(perm.IsUnrestricted(), "CreatePermission.IsUnrestricted");
        }
        public void Open()
        {
            FileDialogPermissionAttribute attr = new FileDialogPermissionAttribute(SecurityAction.Assert);

            attr.Open = true;
            attr.Save = false;
            Assert.IsTrue(attr.Open, "Open=Open");
            Assert.IsFalse(attr.Save, "Open=Save");
            FileDialogPermission p = (FileDialogPermission)attr.CreatePermission();

            Assert.AreEqual(FileDialogPermissionAccess.Open, p.Access, "Open=FileDialogPermission");
        }
        public void Default()
        {
            FileDialogPermissionAttribute a = new FileDialogPermissionAttribute(SecurityAction.Assert);

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

            FileDialogPermission perm = (FileDialogPermission)a.CreatePermission();

            Assert.IsFalse(perm.IsUnrestricted(), "CreatePermission-IsUnrestricted");
        }
        public void OpenSave()
        {
            FileDialogPermissionAttribute attr = new FileDialogPermissionAttribute(SecurityAction.Assert);

            attr.Open = true;
            attr.Save = true;
            Assert.IsTrue(attr.Open, "OpenSave=Open");
            Assert.IsTrue(attr.Save, "OpenSave=Save");
            FileDialogPermission p = (FileDialogPermission)attr.CreatePermission();

            Assert.AreEqual(FileDialogPermissionAccess.OpenSave, p.Access, "OpenSave=FileDialogPermission");
            Assert.IsTrue(p.IsUnrestricted(), "OpenSave=Unrestricted");
        }
Exemplo n.º 5
0
 public static void FileDialogPermissionAttributeCallMethods()
 {
     FileDialogPermissionAttribute fspa = new FileDialogPermissionAttribute(new Permissions.SecurityAction());
     IPermission ip = fspa.CreatePermission();
 }
Exemplo n.º 6
0
 public static void FileDialogPermissionAttributeCallMethods()
 {
     FileDialogPermissionAttribute fspa = new FileDialogPermissionAttribute(new Permissions.SecurityAction());
     IPermission ip = fspa.CreatePermission();
 }