/// <inheritdoc/>
 public override int GetHashCode()
 {
     // Overflow is fine, just wrap
     unchecked
     {
         int hash = (int)2166136261;
         hash = hash * 16777619 ^ Member.GetHashCode();
         hash = hash * 16777619 ^ AccessTarget.GetHashCode();
         hash = hash * 16777619 ^ AccessTypes.GetHashCode();
         return(hash);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MemberAccessInfo"/> struct.
 /// </summary>
 /// <param name="member">The <see cref="MemberInfo"/> that has been accessed.</param>
 /// <param name="accessTarget">The access target for this <paramref name="member"/>.</param>
 /// <param name="accessTypes">The types of performed access.</param>
 public MemberAccessInfo(MemberInfo member, AccessTarget accessTarget, AccessTypes accessTypes)
 {
     Member       = member ?? throw new ArgumentNullException(nameof(member));
     AccessTarget = accessTarget;
     AccessTypes  = accessTypes;
 }
示例#3
0
 /// <summary>
 /// Stores the access action for the specified access <paramref name="member"/>.
 /// </summary>
 /// <param name="member">The type member being accessed.</param>
 /// <param name="accessTarget">The access target of the <paramref name="member"/>.</param>
 /// <param name="accessTypes">The types of the access action.</param>
 /// <exception cref="ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
 public void StoreAccess(MemberInfo member, AccessTarget accessTarget, AccessTypes accessTypes)
 {
     StoreData(member, a => a | accessTypes);
     _targets[member] = accessTarget;
 }