Exemple #1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         return((MemberType.GetHashCode() * 397) ^ MemberName.GetHashCode());
     }
 }
Exemple #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (MemberType != global::Google.Ads.GoogleAds.V7.Enums.CustomAudienceMemberTypeEnum.Types.CustomAudienceMemberType.Unspecified)
            {
                hash ^= MemberType.GetHashCode();
            }
            if (valueCase_ == ValueOneofCase.Keyword)
            {
                hash ^= Keyword.GetHashCode();
            }
            if (valueCase_ == ValueOneofCase.Url)
            {
                hash ^= Url.GetHashCode();
            }
            if (valueCase_ == ValueOneofCase.PlaceCategory)
            {
                hash ^= PlaceCategory.GetHashCode();
            }
            if (valueCase_ == ValueOneofCase.App)
            {
                hash ^= App.GetHashCode();
            }
            hash ^= (int)valueCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #3
0
        public MemberIdentifier(ITypeInfoSource ti, PropertyReference pr)
        {
            Type                 = MemberType.Property;
            Name                 = pr.Name;
            ReturnType           = pr.PropertyType;
            GenericArgumentCount = 0;
            ParameterTypes       = null;
            ti.CacheProxyNames(pr);

            var pd = pr.Resolve();

            if (pd != null)
            {
                if (pd.GetMethod != null)
                {
                    ParameterTypes = GetParameterTypes(pd.GetMethod.Parameters);
                }
                else if (pd.SetMethod != null)
                {
                    ParameterTypes = GetParameterTypes(pd.SetMethod.Parameters)
                                     .Take(pd.SetMethod.Parameters.Count - 1).ToArray();
                }
            }

            HashCode = Type.GetHashCode() ^ Name.GetHashCode();
        }
Exemple #4
0
        public MemberIdentifier(ITypeInfoSource ti, EventReference er)
        {
            Type                 = MemberType.Event;
            Name                 = er.Name;
            ReturnType           = er.EventType;
            GenericArgumentCount = 0;
            ParameterTypes       = null;
            ti.CacheProxyNames(er);

            var ed = er.Resolve();

            if (ed != null)
            {
                if (ed.AddMethod != null)
                {
                    IsStatic = ed.AddMethod.IsStatic;
                }
                else if (ed.RemoveMethod != null)
                {
                    IsStatic = ed.RemoveMethod.IsStatic;
                }
                else
                {
                    // FIXME
                    IsStatic = false;
                }
            }
            else
            {
                // FIXME
                IsStatic = false;
            }

            HashCode = Type.GetHashCode() ^ Name.GetHashCode();
        }
Exemple #5
0
        public MemberIdentifier(ITypeInfoSource ti, MethodReference mr, string newName = null)
        {
            IsStatic       = !mr.HasThis;
            Type           = MemberType.Method;
            Name           = newName ?? mr.Name;
            ReturnType     = mr.ReturnType;
            ParameterTypes = GetParameterTypes(mr.Parameters);

            if (mr is GenericInstanceMethod)
            {
                GenericArgumentCount = ((GenericInstanceMethod)mr).GenericArguments.Count;
            }
            else if (mr.HasGenericParameters)
            {
                GenericArgumentCount = mr.GenericParameters.Count;
            }
            else
            {
                GenericArgumentCount = 0;
            }

            ti.CacheProxyNames(mr);

            HashCode = Type.GetHashCode() ^ Name.GetHashCode();
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Member.Name.GetHashCode());
         hashCode = (hashCode * 397) ^ (MemberType.GetHashCode());
         return(hashCode);
     }
 }
Exemple #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MemberType != null ? MemberType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DeclaringType != null ? DeclaringType.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemple #8
0
        public MemberIdentifier(ITypeInfoSource ti, EventReference er)
        {
            Type                 = MemberType.Event;
            Name                 = er.Name;
            ReturnType           = er.EventType;
            GenericArgumentCount = 0;
            ParameterTypes       = null;
            ti.CacheProxyNames(er);

            HashCode = Type.GetHashCode() ^ Name.GetHashCode();
        }
Exemple #9
0
        public MemberIdentifier(ITypeInfoSource ti, FieldReference fr)
        {
            Type                 = MemberType.Field;
            Name                 = fr.Name;
            ReturnType           = fr.FieldType;
            GenericArgumentCount = 0;
            ParameterTypes       = null;
            ti.CacheProxyNames(fr);

            HashCode = Type.GetHashCode() ^ Name.GetHashCode();
        }
Exemple #10
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (MemberType != 0)
            {
                hash ^= MemberType.GetHashCode();
            }
            if (parameter_ != null)
            {
                hash ^= Parameter.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #11
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (MemberType != global::Google.Ads.GoogleAds.V6.Enums.CustomInterestMemberTypeEnum.Types.CustomInterestMemberType.Unspecified)
            {
                hash ^= MemberType.GetHashCode();
            }
            if (HasParameter)
            {
                hash ^= Parameter.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemple #12
0
        private MemberIdentifier(
            bool isStatic,
            MemberType type,
            string name,
            TypeReference returnType,
            TypeReference[] parameterTypes,
            int genericArgumentCount
            )
        {
            IsStatic             = isStatic;
            Type                 = type;
            Name                 = name;
            ReturnType           = returnType;
            ParameterTypes       = parameterTypes;
            GenericArgumentCount = genericArgumentCount;

            HashCode = Type.GetHashCode() ^ Name.GetHashCode();
        }
Exemple #13
0
        public MemberIdentifier(ITypeInfoSource ti, FieldReference fr)
        {
            Type                 = MemberType.Field;
            Name                 = fr.Name;
            ReturnType           = fr.FieldType;
            GenericArgumentCount = 0;
            ParameterTypes       = null;
            ti.CacheProxyNames(fr);

            var resolved = fr.Resolve();

            if (resolved != null)
            {
                IsStatic = resolved.IsStatic;
            }
            else
            {
                // FIXME
                IsStatic = false;
            }

            HashCode = Type.GetHashCode() ^ Name.GetHashCode();
        }
 public override int GetHashCode()
 {
     return(MemberType.GetHashCode() + 37 * StringComparer.Ordinal.GetHashCode(Name));
 }