// </snippet2>

//<snippet3>
        public static SmtpPermission CreatePermissionCopy(SmtpPermission p)
        {
            SmtpPermission copy = (SmtpPermission)p.Copy();

            return(copy);
        }
        public void FromXml_Null()
        {
            SmtpPermission sp = new SmtpPermission(PermissionState.None);

            sp.FromXml(null);
        }
        public void Union_BadPermission()
        {
            SmtpPermission sp = new SmtpPermission(PermissionState.None);

            sp.Union(new SecurityPermission(PermissionState.Unrestricted));
        }
        public void IsSubset_BadPermission()
        {
            SmtpPermission sp = new SmtpPermission(PermissionState.None);

            sp.IsSubsetOf(new SecurityPermission(PermissionState.Unrestricted));
        }
        public void Intersect_BadPermission()
        {
            SmtpPermission sp = new SmtpPermission(PermissionState.None);

            sp.Intersect(new SecurityPermission(PermissionState.Unrestricted));
        }
Exemple #6
0
// </snippet4>
// <snippet5>
        public static SmtpPermission GiveFullAccess(SmtpPermission permission)
        {
            permission.AddPermission(SmtpAccess.Connect);
            return(permission);
        }