+
+ public override Module Module {
+ get {
+ return GetRuntimeModule ();
+ }
+ }
+
+ RuntimeType ReflectedTypeInternal {
+ get {
+ return (RuntimeType) ReflectedType;
+ }
+ }
+
+ internal override string FormatNameAndSig (bool serialization)
+ {
+ // Serialization uses ToString to resolve MethodInfo overloads.
+ StringBuilder sbName = new StringBuilder(Name);
+
+ // serialization == true: use unambiguous (except for assembly name) type names to distinguish between overloads.
+ // serialization == false: use basic format to maintain backward compatibility of MethodInfo.ToString().
+ TypeNameFormatFlags format = serialization ? TypeNameFormatFlags.FormatSerialization : TypeNameFormatFlags.FormatBasic;
+
+ if (IsGenericMethod)
+ sbName.Append(RuntimeMethodHandle.ConstructInstantiation(this, format));
+
+ sbName.Append("(");
+ ParameterInfo.FormatParameters (sbName, GetParametersNoCopy (), CallingConvention, serialization);
+ sbName.Append(")");
+
+ return sbName.ToString();
+ }
+
+ public override String ToString()
+ {
+ return ReturnType.FormatTypeName() + " " + FormatNameAndSig(false);
+ }
+
+ internal RuntimeModule GetRuntimeModule ()
+ {
+ return ((RuntimeType)DeclaringType).GetRuntimeModule();
+ }
+
+ #region ISerializable Implementation
+ public void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ if (info == null)
+ throw new ArgumentNullException("info");
+ Contract.EndContractBlock();
+
+ MemberInfoSerializationHolder.GetSerializationInfo(
+ info,
+ Name,
+ ReflectedTypeInternal,
+ ToString(),
+ SerializationToString(),
+ MemberTypes.Method,
+ IsGenericMethod & !IsGenericMethodDefinition ? GetGenericArguments() : null);
+ }
+
+ internal string SerializationToString()
+ {
+ return ReturnType.FormatTypeName(true) + " " + FormatNameAndSig(true);
+ }
+ #endregion