System.Security.Permissions.ResourcePermissionBase.Copy C# (CSharp) Method

Copy() public method

public Copy ( ) : IPermission
return IPermission
        public override IPermission Copy() {
            ResourcePermissionBase permission = CreateInstance();
            permission.tagNames = this.tagNames;
            permission.permissionAccessType = this.permissionAccessType;
            permission.isUnrestricted = this.isUnrestricted;
            permission.rootTable = CopyChildren(this.rootTable, 0);
            return permission;
        }

Usage Example

        public override IPermission Intersect(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            if (target.GetType() != base.GetType())
            {
                throw new ArgumentException(SR.GetString("PermissionTypeMismatch"), "target");
            }
            ResourcePermissionBase base2 = (ResourcePermissionBase)target;

            if (this.IsUnrestricted())
            {
                return(base2.Copy());
            }
            if (base2.IsUnrestricted())
            {
                return(this.Copy());
            }
            ResourcePermissionBase base3 = null;
            Hashtable hashtable          = (Hashtable)this.IntersectContents(this.rootTable, base2.rootTable);

            if (hashtable != null)
            {
                base3           = this.CreateInstance();
                base3.rootTable = hashtable;
            }
            return(base3);
        }
All Usage Examples Of System.Security.Permissions.ResourcePermissionBase::Copy