System.Security.Permissions.UrlIdentityPermission.Copy C# (CSharp) Метод

Copy() публичный Метод

public Copy ( ) : IPermission
Результат IPermission
        public override IPermission Copy()
        {
            return default(IPermission);
        }

Same methods

UrlIdentityPermission::Copy ( ) : System.Security.IPermission

Usage Example

        /// <summary>Creates a permission that is the union of the current permission and the specified permission.</summary>
        /// <returns>A new permission that represents the union of the current permission and the specified permission.</returns>
        /// <param name="target">A permission to combine with the current permission. It must be of the same type as the current permission. </param>
        /// <exception cref="T:System.ArgumentException">The <paramref name="target" /> parameter is not null and is not of the same type as the current permission. -or-The <see cref="P:System.Security.Permissions.UrlIdentityPermission.Url" /> property is not a valid URL.-or-The two permissions are not equal and one is not a subset of the other.</exception>
        public override IPermission Union(IPermission target)
        {
            UrlIdentityPermission urlIdentityPermission = this.Cast(target);

            if (urlIdentityPermission == null)
            {
                return(this.Copy());
            }
            if (this.IsEmpty() && urlIdentityPermission.IsEmpty())
            {
                return(null);
            }
            if (urlIdentityPermission.IsEmpty())
            {
                return(this.Copy());
            }
            if (this.IsEmpty())
            {
                return(urlIdentityPermission.Copy());
            }
            if (!this.Match(urlIdentityPermission.url))
            {
                throw new ArgumentException(Locale.GetText("Cannot union two different urls."), "target");
            }
            if (this.url.Length < urlIdentityPermission.url.Length)
            {
                return(this.Copy());
            }
            return(urlIdentityPermission.Copy());
        }
All Usage Examples Of System.Security.Permissions.UrlIdentityPermission::Copy