コード例 #1
0
 public bool IsCompatibleWith(BasicSignature other)
 {
     return(CallingConvention == other.CallingConvention &&
            ((ParameterTypes == null && other.ParameterTypes == null) ||
             ParameterTypes.SequenceEqual(other.ParameterTypes)) &&
            ReturnType.Equals(other.ReturnType));
 }
コード例 #2
0
        public override bool NotNullObjectEquals(ClepsType obj)
        {
            if (obj.GetType() != typeof(FunctionClepsType))
            {
                return(false);
            }

            FunctionClepsType objToCompare = obj as FunctionClepsType;

            return(ReturnType == objToCompare.ReturnType && ParameterTypes.SequenceEqual(objToCompare.ParameterTypes));
        }
コード例 #3
0
        public override bool Equals(object obj)
        {
            var otherMethod = obj as MethodValidationResult;

            if (otherMethod == null)
            {
                return(false);
            }

            if (!otherMethod.MethodName.Equals(MethodName))
            {
                return(false);
            }

            return(ParameterTypes.SequenceEqual(otherMethod.ParameterTypes));
        }
コード例 #4
0
ファイル: FuncType.cs プロジェクト: Rohansi/LoonyC
        public override bool Equals(TypeBase other)
        {
            if (!base.Equals(other))
            {
                return(false);
            }

            var otherFunc = other as FuncType;

            if (otherFunc == null)
            {
                return(false);
            }

            return(IsConstant == other.IsConstant &&
                   ParameterTypes.SequenceEqual(otherFunc.ParameterTypes) &&
                   ReturnType == otherFunc.ReturnType);
        }
コード例 #5
0
        /// <summary>
        /// Check the equivalence of this object and the argument object.
        /// </summary>
        /// <param name="obj">Target object.</param>
        /// <returns>It returns True if equivalent, False otherwise.</returns>
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            var member        = (Member)obj;
            var boolcollector = new BoolCollector();

            boolcollector.ChangeBool("Accessibility", Accessibility == member.Accessibility);
            boolcollector.ChangeBool("Id", Id.Equals(member.Id));
            boolcollector.ChangeBool("Name", Name.Equals(member.Name));
            boolcollector.ChangeBool("Namespace", Namespace.Equals(member.Namespace));
            boolcollector.ChangeBool("Parameters", ParameterNames.SequenceEqual(member.ParameterNames));
            boolcollector.ChangeBool("ParameterTypes", ParameterTypes.SequenceEqual(member.ParameterTypes));
            boolcollector.ChangeBool("ReturnComment", ReturnComment.Equals(member.ReturnComment));
            boolcollector.ChangeBool("ReturnType", ReturnType.Equals(member.ReturnType));
            boolcollector.ChangeBool("Type", Type == member.Type);
            boolcollector.ChangeBool("Value", Value.Equals(member.Value));

            return(boolcollector.Value);
        }
コード例 #6
0
        /// <summary>
        /// Determines whether or not the current instance has the same signature as another.
        /// </summary>
        /// <param name="other">The other method info.</param>
        /// <returns>true if the signatures are the same; otherwise, false.</returns>
        public bool HasSameSignatureAs([NotNull] IntrospectiveMethodInfo other)
        {
            if (Name != other.Name)
            {
                return(false);
            }

            if (ReturnType != other.ReturnType)
            {
                return(false);
            }

            if (ParameterTypes.Count != other.ParameterTypes.Count)
            {
                return(false);
            }

            if (!ParameterTypes.SequenceEqual(other.ParameterTypes))
            {
                return(false);
            }

            return(true);
        }
コード例 #7
0
        public bool Matches(TypeManager typeManager, IMethodDefinition method)
        {
            var paramTypes = method.Parameters.Select(p => typeManager.ConvertCCITypeToAssemblyQualifiedName(p.Type));

            return(Name.Equals(method.Name.Value) && ParameterTypes.SequenceEqual(paramTypes));
        }
コード例 #8
0
        public override bool Equals(object obj)
        {
            var other = obj as InvocationTarget;

            return(other != null && TypeName == other.TypeName && MethodName == other.MethodName && ParameterTypes.SequenceEqual(other.ParameterTypes));
        }