public TypeSignature(Type t) { Type = t; if (t.IsGenericTypeDefinition) { GenericSignature = new GenericSignature(t.GetGenericArguments()); } }
public MethodSignature(MethodInfo method) { Method = method; if (method.IsGenericMethodDefinition) { GenericSignature = new GenericSignature(method.GetGenericArguments()); } ParameterSignatures = method.GetParameters().Select(a => new ParameterSignature(a)).ToArray(); }
public bool CanBeRelaxedTo(MethodSignature other) { if (!Name.Equals(other.Name, StringComparison.Ordinal)) { return(false); } if (!AttributesCanBeRelaxedTo(other.Attributes)) { return(false); } if (IsGeneric != other.IsGeneric) { return(false); } if (IsGeneric && GenericSignature.Equals(other.GenericSignature)) { return(false); } if (!ReturnType.Equals(other.ReturnType)) { return(false); } if (ParameterSignatures.Length != other.ParameterSignatures.Length) { return(false); } for (int i = 0; i < ParameterSignatures.Length; ++i) { if (!ParameterSignatures[i].Equals(other.ParameterSignatures[i])) { return(false); } } return(true); }