mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
28 lines
790 B
C#
28 lines
790 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Mono.Cecil;
|
|
|
|
namespace System {
|
|
public static class MethodReferenceExtensions {
|
|
public static string GetFullName(this MethodReference aSelf) {
|
|
StringBuilder sb = new StringBuilder(aSelf.DeclaringType.FullName + "." + aSelf.Name);
|
|
sb.Append("(");
|
|
if (aSelf.Parameters.Count > 0) {
|
|
|
|
foreach (ParameterDefinition xParam in aSelf.Parameters) {
|
|
sb.Append(xParam.ParameterType.FullName);
|
|
sb.Append(",");
|
|
}
|
|
}
|
|
return sb.ToString().TrimEnd(',') + ")";
|
|
}
|
|
}
|
|
|
|
public static class FieldReferenceExtensions {
|
|
public static string GetFullName(this FieldReference aSelf) {
|
|
return aSelf.DeclaringType.FullName + "." + aSelf.Name;
|
|
}
|
|
}
|
|
}
|