Clone() public method

Creates a new instance Claim with values copied from this object.
public Clone ( ) : Claim
return Claim
Example #1
0
 private void SafeAddClaim(Claim claim)
 {
     if (claim.Subject == this)
     {
         this.m_instanceClaims.Add(claim);
     }
     else
     {
         this.m_instanceClaims.Add(claim.Clone(this));
     }
 }
Example #2
0
 void SafeAddClaim(Claim claim)
 {
     if (object.ReferenceEquals(claim.Subject, this))
     {
         m_instanceClaims.Add(claim);
     }
     else
     {
         m_instanceClaims.Add(claim.Clone(this));
     }
 }
Example #3
0
        /// <summary>
        /// Adds a single <see cref="Claim"/> to an internal list.
        /// </summary>
        /// <param name="claim">the <see cref="Claim"/>add.</param>
        /// <remarks>If <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks>
        /// <exception cref="ArgumentNullException">if 'claim' is null.</exception>
        public virtual void AddClaim(Claim claim)
        {
            ArgumentNullException.ThrowIfNull(claim);

            if (object.ReferenceEquals(claim.Subject, this))
            {
                _instanceClaims.Add(claim);
            }
            else
            {
                _instanceClaims.Add(claim.Clone(this));
            }
        }
Example #4
0
        public virtual void AddClaim(Claim claim)
        {
            if (claim == null)
            {
                throw new ArgumentNullException("claim");
            }

            if (claim.Subject != this)
            {
                claim = claim.Clone(this);
            }

            claims.Add(claim);
        }
Example #5
0
 public virtual void AddClaim(Claim claim)
 {
     if (claim == null)
     {
         throw new ArgumentNullException("claim");
     }
     if (claim.Subject == this)
     {
         this.m_instanceClaims.Add(claim);
     }
     else
     {
         this.m_instanceClaims.Add(claim.Clone(this));
     }
 }
Example #6
0
        /// <summary>
        /// Adds claim to internal list. Calling Claim.Clone if Claim.Subject != this.
        /// </summary>
        /// <remarks>private only call from constructor, adds to internal list.</remarks>
        private void SafeAddClaim(Claim claim)
        {
            if (claim == null)
            {
                return;
            }

            if (object.ReferenceEquals(claim.Subject, this))
            {
                _instanceClaims.Add(claim);
            }
            else
            {
                _instanceClaims.Add(claim.Clone(this));
            }
        }
Example #7
0
        /// <summary>
        /// Adds a single <see cref="Claim"/> to an internal list.
        /// </summary>
        /// <param name="claim">the <see cref="Claim"/>add.</param>
        /// <remarks>If <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks>
        /// <exception cref="ArgumentNullException">if 'claim' is null.</exception>
        public virtual void AddClaim(Claim claim)
        {
            if (claim == null)
            {
                throw new ArgumentNullException(nameof(claim));
            }

            if (object.ReferenceEquals(claim.Subject, this))
            {
                _instanceClaims.Add(claim);
            }
            else
            {
                _instanceClaims.Add(claim.Clone(this));
            }
        }
Example #8
0
        public virtual void AddClaim(Claim claim)
        {
            if (claim == null)
            {
                throw new ArgumentNullException("claim");
            }

            Contract.EndContractBlock();

            if (object.ReferenceEquals(claim.Subject, this))
            {
                m_instanceClaims.Add(claim);
            }
            else
            {
                m_instanceClaims.Add(claim.Clone(this));
            }
        }
Example #9
0
 void SafeAddClaim(Claim claim)
 {
     if (object.ReferenceEquals(claim.Subject, this))
     {
         m_instanceClaims.Add(claim);
     }
     else
     {
         m_instanceClaims.Add(claim.Clone(this));
     }
 }
Example #10
0
        public virtual void AddClaim(Claim claim)
        {
            if (claim == null)
            {
                throw new ArgumentNullException("claim");
            }

            Contract.EndContractBlock();

            if(object.ReferenceEquals(claim.Subject, this))
            {
                m_instanceClaims.Add(claim);
            }
            else
            {
                m_instanceClaims.Add(claim.Clone(this));
            }
        }
Example #11
0
        /// <summary>
        /// Adds claim to intenal list. Calling Claim.Clone if Claim.Subject != this.
        /// </summary>
        /// <remarks>private only call from constructor, adds to internal list.</remarks>
        private void SafeAddClaim(Claim claim)
        {
            if (claim == null)
                return;

            if (object.ReferenceEquals(claim.Subject, this))
            {
                _instanceClaims.Add(claim);
            }
            else
            {
                _instanceClaims.Add(claim.Clone(this));
            }
        }
Example #12
0
		public virtual void AddClaim (Claim claim)
		{
			if (claim == null)
				throw new ArgumentNullException ("claim");

			if (claim.Subject != this)
				claim = claim.Clone (this);

			claims.Add (claim);
		}