mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
36 lines
No EOL
876 B
C#
36 lines
No EOL
876 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using ICSharpCode.ILSpy;
|
|
using Mono.Cecil;
|
|
|
|
namespace Cosmos.ILSpyPlugs.Plugin
|
|
{
|
|
public static class Utilities
|
|
{
|
|
public static string GetCSharpTypeName(TypeReference reference)
|
|
{
|
|
var xCSharp = Languages.GetLanguage("C#");
|
|
|
|
return xCSharp.TypeToString(reference, true);
|
|
}
|
|
|
|
public static string GetMethodName(MethodDefinition method)
|
|
{
|
|
if (method.IsConstructor)
|
|
{
|
|
if (method.IsStatic)
|
|
{
|
|
return "Cctor";
|
|
}
|
|
else
|
|
{
|
|
return "Ctor";
|
|
}
|
|
}
|
|
return method.Name;
|
|
}
|
|
}
|
|
} |